tweaking + notes..

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2017-04-21 14:52:58 +03:00
parent dad312daa4
commit c64fe92afe
2 changed files with 26 additions and 9 deletions

View File

@ -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
}],
})

View File

@ -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()