mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30: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 ribbons = this.ribbons
|
||||||
|
|
||||||
var t = Date.now()
|
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']
|
var timeout = this.config['ribbons-in-place-update-timeout']
|
||||||
|
|
||||||
// localize transition prevention...
|
// localize transition prevention...
|
||||||
@ -94,7 +94,7 @@ var PartialRibbonsActions = actions.Actions({
|
|||||||
|| (loaded < size && na + pa > loaded)
|
|| (loaded < size && na + pa > loaded)
|
||||||
// ribbon too long...
|
// ribbon too long...
|
||||||
|| loaded > size * threshold){
|
|| loaded > size * threshold){
|
||||||
console.log('RESIZE')
|
//console.log('RESIZE')
|
||||||
this.resizeRibbon(target, size)
|
this.resizeRibbon(target, size)
|
||||||
|
|
||||||
// more complex cases...
|
// more complex cases...
|
||||||
@ -110,16 +110,30 @@ var PartialRibbonsActions = actions.Actions({
|
|||||||
|| r.length == 0
|
|| r.length == 0
|
||||||
// only if we are going slow...
|
// only if we are going slow...
|
||||||
|| (timeout != null
|
|| (timeout != null
|
||||||
&& (t - this.__last_update > timeout))
|
&& (t - this.__last_ribbon_update > timeout))
|
||||||
// full screen...
|
// full screen...
|
||||||
|| (this.toggleSingleImage
|
|| (this.toggleSingleImage
|
||||||
&& this.toggleSingleImage('?') == 'on')){
|
&& this.toggleSingleImage('?') == 'on')){
|
||||||
//console.log('RESIZE', t-this.__last_update)
|
//console.log('RESIZE', t-this.__last_ribbon_update)
|
||||||
this.resizeRibbon(target, size)
|
this.resizeRibbon(target, size)
|
||||||
|
|
||||||
// in-place update...
|
// 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 {
|
} 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 c = gids.indexOf(data.getImage('current', r_gid))
|
||||||
var t = gids.indexOf(target)
|
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...
|
// update gids...
|
||||||
var unload_marks = []
|
var unload_marks = []
|
||||||
gids
|
for(var i = 0; i < gids.length; i++){
|
||||||
.forEach(function(gid, i){
|
var gid = gids[i]
|
||||||
|
//gids
|
||||||
|
// .forEach(function(gid, i){
|
||||||
if(gid !== undefined){
|
if(gid !== undefined){
|
||||||
var img = loaded.eq(i)
|
var img = loaded.eq(i)
|
||||||
|
|
||||||
@ -1682,7 +1684,8 @@ var RibbonsPrototype = {
|
|||||||
// gid && that.updateImage(img, gid)
|
// gid && that.updateImage(img, gid)
|
||||||
gid && that.updateImage(that.setElemGID(img, gid))
|
gid && that.updateImage(that.setElemGID(img, gid))
|
||||||
}
|
}
|
||||||
})
|
// })
|
||||||
|
}
|
||||||
$(unload_marks)
|
$(unload_marks)
|
||||||
.remove()
|
.remove()
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user