mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 10:20:08 +00:00
fixed a bug with sorting by date...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
7849f58ca5
commit
3440ed6538
13
ui/sort.js
13
ui/sort.js
@ -71,7 +71,16 @@ function imageDateCmp(a, b, get, data){
|
||||
a = get(a)
|
||||
b = get(b)
|
||||
}
|
||||
return data[b].ctime - data[a].ctime
|
||||
b = data[b].ctime
|
||||
a = data[a].ctime
|
||||
|
||||
if(a == b){
|
||||
return 0
|
||||
} else if(a < b){
|
||||
return -1
|
||||
} else {
|
||||
return +1
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -187,7 +196,7 @@ function sortImages(cmp, reverse){
|
||||
|
||||
// shorthands...
|
||||
function sortImagesByDate(reverse){
|
||||
return sortImages(reverse)
|
||||
return sortImages(imageDateCmp, reverse)
|
||||
}
|
||||
function sortImagesByFileName(reverse){
|
||||
return sortImages(imageNameCmp, reverse)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user