From c64fe92afe7bb05adcb708bea247f61c83c588d4 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Fri, 21 Apr 2017 14:52:58 +0300 Subject: [PATCH] tweaking + notes.. Signed-off-by: Alex A. Naanou --- ui (gen4)/features/ui-partial-ribbons-2.js | 26 +++++++++++++++++----- ui (gen4)/imagegrid/ribbons.js | 9 +++++--- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/ui (gen4)/features/ui-partial-ribbons-2.js b/ui (gen4)/features/ui-partial-ribbons-2.js index 0301f349..0105022c 100755 --- a/ui (gen4)/features/ui-partial-ribbons-2.js +++ b/ui (gen4)/features/ui-partial-ribbons-2.js @@ -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 }], }) diff --git a/ui (gen4)/imagegrid/ribbons.js b/ui (gen4)/imagegrid/ribbons.js index 62b7b06c..8c90d1bc 100755 --- a/ui (gen4)/imagegrid/ribbons.js +++ b/ui (gen4)/imagegrid/ribbons.js @@ -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()