From 38f26e0c2805882132663dde3ba69407623658e3 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Wed, 19 Apr 2017 00:25:52 +0300 Subject: [PATCH] more tweaking and minor fixes... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/ui-partial-ribbons-2.js | 17 +++++++---------- ui (gen4)/imagegrid/ribbons.js | 7 +++++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ui (gen4)/features/ui-partial-ribbons-2.js b/ui (gen4)/features/ui-partial-ribbons-2.js index d6f47bd2..ae8b6602 100755 --- a/ui (gen4)/features/ui-partial-ribbons-2.js +++ b/ui (gen4)/features/ui-partial-ribbons-2.js @@ -15,9 +15,6 @@ var core = require('features/core') /*********************************************************************/ -// XXX do we need to do most of the work here on in imagegrid/data.js??? -// ...another question would be if we can do this using existing -// functionality? var PartialRibbonsActions = actions.Actions({ config: { @@ -31,11 +28,9 @@ var PartialRibbonsActions = actions.Actions({ 'ribbon-resize-threshold': 2, // Sets size of ribbons in single image mode... - 'ribbons-resize-single-image': 13, + 'ribbons-resize-single-image': 21, }, - // XXX preload??? - updateRibbon: ['- Interface/Update partial ribbon size', function(target, w, size, threshold){ target = target instanceof jQuery @@ -87,7 +82,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) //*/ @@ -133,9 +128,11 @@ var PartialRibbonsActions = actions.Actions({ || (pl < update_threshold && pa > pl) // loaded more than we need by threshold... || nl + pl + 1 > size + update_threshold){ - console.log('UPDATE') - r.length == 0 ? - // ribbon not loaded... + //console.log('UPDATE') + (r.length == 0 + || (this.toggleSingleImage + && this.toggleSingleImage('?') == 'on')) ? + // resize... this.resizeRibbon(target, size) // simply update... : this.ribbons diff --git a/ui (gen4)/imagegrid/ribbons.js b/ui (gen4)/imagegrid/ribbons.js index a9183bb6..40f0d379 100755 --- a/ui (gen4)/imagegrid/ribbons.js +++ b/ui (gen4)/imagegrid/ribbons.js @@ -1638,6 +1638,8 @@ var RibbonsPrototype = { // NOTE: reference must be both present in the loaded ribbon and in // the given gids... + // XXX need to clean out marks of unloaded images... + // XXX need to sync the offset and image loading... updateRibbonInPlace: function(gids, ribbon, reference){ var that = this var r = this.getRibbon(ribbon) @@ -1665,8 +1667,9 @@ var RibbonsPrototype = { } // update gids... - $(gids.slice(0, loaded.length)) - .each(function(i, gid){ + gids + .slice(0, loaded.length) + .forEach(function(gid, i){ gid && that.setElemGID(loaded.eq(i), gid) }) // update images...