mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-11-01 03:40:09 +00:00
refixed a bug in getGIDsAfter(..)...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
943f4ba4a0
commit
e9370e7bdd
19
ui/data.js
19
ui/data.js
@ -1448,18 +1448,10 @@ function getGIDsAfter(count, gid, ribbon, inclusive, data){
|
|||||||
data = data == null ? DATA : data
|
data = data == null ? DATA : data
|
||||||
ribbon = ribbon == null ? getRibbonIndex() : ribbon
|
ribbon = ribbon == null ? getRibbonIndex() : ribbon
|
||||||
count = count == null ? Math.round(LOAD_SCREENS * getScreenWidthInImages()) : count
|
count = count == null ? Math.round(LOAD_SCREENS * getScreenWidthInImages()) : count
|
||||||
|
ribbon = ribbon == null ? getGIDRibbonIndex(gid, data) : ribbon
|
||||||
|
|
||||||
// ribbon default value...
|
// get a local gid...
|
||||||
// XXX Race condition: if DATA is not yet loaded this can return
|
gid = data.ribbons[ribbon].indexOf(gid) < 0 ? getGIDBefore(gid, ribbon) : gid
|
||||||
// ribbon == null...
|
|
||||||
if(ribbon == null){
|
|
||||||
$(data.ribbons).each(function(i, e){
|
|
||||||
if(e.indexOf(gid) >= 0){
|
|
||||||
ribbon = i
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
ribbon = data.ribbons[ribbon]
|
ribbon = data.ribbons[ribbon]
|
||||||
|
|
||||||
// ribbon this is empty or non-existant...
|
// ribbon this is empty or non-existant...
|
||||||
@ -1478,9 +1470,6 @@ function getGIDsAfter(count, gid, ribbon, inclusive, data){
|
|||||||
} else {
|
} else {
|
||||||
var c = inclusive == null ? 0 : 1
|
var c = inclusive == null ? 0 : 1
|
||||||
var end = ribbon.indexOf(gid)
|
var end = ribbon.indexOf(gid)
|
||||||
// avoid -1 value that will wrap around the tail and load the
|
|
||||||
// whole ribbon...
|
|
||||||
end = end < 0 ? 0 : end
|
|
||||||
return ribbon.slice((Math.abs(count) >= end ? 0 : end + count + c), end + c)
|
return ribbon.slice((Math.abs(count) >= end ? 0 : end + count + c), end + c)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1804,6 +1793,8 @@ function loadSettings(){
|
|||||||
// loaded/rendered...
|
// loaded/rendered...
|
||||||
// NOTE: this is not meant to be a real cache, rather a que for the OS and
|
// NOTE: this is not meant to be a real cache, rather a que for the OS and
|
||||||
// backend/webkit on what's next...
|
// backend/webkit on what's next...
|
||||||
|
//
|
||||||
|
// XXX this appears to actually make things slower and laggy...
|
||||||
function preCacheRibbonImages(ribbon){
|
function preCacheRibbonImages(ribbon){
|
||||||
var deferred = $.Deferred()
|
var deferred = $.Deferred()
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user