mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-28 18:00:09 +00:00
tweaking + notes..
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
dad312daa4
commit
c64fe92afe
@ -61,7 +61,7 @@ var PartialRibbonsActions = actions.Actions({
|
||||
var ribbons = this.ribbons
|
||||
|
||||
var t = Date.now()
|
||||
this.__last_update = this.__last_update || t
|
||||
this.__last_ribbon_update = this.__last_ribbon_update || t
|
||||
var timeout = this.config['ribbons-in-place-update-timeout']
|
||||
|
||||
// localize transition prevention...
|
||||
@ -94,7 +94,7 @@ var PartialRibbonsActions = actions.Actions({
|
||||
|| (loaded < size && na + pa > loaded)
|
||||
// ribbon too long...
|
||||
|| loaded > size * threshold){
|
||||
console.log('RESIZE')
|
||||
//console.log('RESIZE')
|
||||
this.resizeRibbon(target, size)
|
||||
|
||||
// more complex cases...
|
||||
@ -110,16 +110,30 @@ var PartialRibbonsActions = actions.Actions({
|
||||
|| r.length == 0
|
||||
// only if we are going slow...
|
||||
|| (timeout != null
|
||||
&& (t - this.__last_update > timeout))
|
||||
&& (t - this.__last_ribbon_update > timeout))
|
||||
// full screen...
|
||||
|| (this.toggleSingleImage
|
||||
&& this.toggleSingleImage('?') == 'on')){
|
||||
//console.log('RESIZE', t-this.__last_update)
|
||||
//console.log('RESIZE', t-this.__last_ribbon_update)
|
||||
this.resizeRibbon(target, size)
|
||||
|
||||
// in-place update...
|
||||
// XXX this is faster than .resizeRibbon(..) but it's not
|
||||
// used unconditionally because I can't get rid or
|
||||
// sync up images being replaced...
|
||||
// ...note that .resizeRibbon(..) is substantially
|
||||
// slower (updates DOM), i.e. introduces a lag, but
|
||||
// the results look OK...
|
||||
//
|
||||
// Approaches:
|
||||
// - preloading a target section off-screen
|
||||
// ...results in two freezes instead of one
|
||||
// - CSS will-change: background-image (???)
|
||||
// - revise .updateImage(..)
|
||||
//
|
||||
// Q: can this be done within 1/60s???
|
||||
} else {
|
||||
//console.log('UPDATE', t - this.__last_update)
|
||||
//console.log('UPDATE', t - this.__last_ribbon_update)
|
||||
var c = gids.indexOf(data.getImage('current', r_gid))
|
||||
var t = gids.indexOf(target)
|
||||
|
||||
@ -130,7 +144,7 @@ var PartialRibbonsActions = actions.Actions({
|
||||
}
|
||||
}
|
||||
|
||||
this.__last_update = t
|
||||
this.__last_ribbon_update = t
|
||||
}],
|
||||
})
|
||||
|
||||
|
||||
@ -1667,8 +1667,10 @@ var RibbonsPrototype = {
|
||||
|
||||
// update gids...
|
||||
var unload_marks = []
|
||||
gids
|
||||
.forEach(function(gid, i){
|
||||
for(var i = 0; i < gids.length; i++){
|
||||
var gid = gids[i]
|
||||
//gids
|
||||
// .forEach(function(gid, i){
|
||||
if(gid !== undefined){
|
||||
var img = loaded.eq(i)
|
||||
|
||||
@ -1682,7 +1684,8 @@ var RibbonsPrototype = {
|
||||
// gid && that.updateImage(img, gid)
|
||||
gid && that.updateImage(that.setElemGID(img, gid))
|
||||
}
|
||||
})
|
||||
// })
|
||||
}
|
||||
$(unload_marks)
|
||||
.remove()
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user