From a9cf6f39b678a289a93ab9570d17f998a8d1c79d Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Wed, 19 Apr 2017 21:39:25 +0300 Subject: [PATCH] more tweaking... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/ui-partial-ribbons-2.js | 4 ++-- ui (gen4)/imagegrid/ribbons.js | 18 +++++++++++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/ui (gen4)/features/ui-partial-ribbons-2.js b/ui (gen4)/features/ui-partial-ribbons-2.js index e97060b6..84a04726 100755 --- a/ui (gen4)/features/ui-partial-ribbons-2.js +++ b/ui (gen4)/features/ui-partial-ribbons-2.js @@ -144,6 +144,7 @@ var PartialRibbonsActions = actions.Actions({ : this.ribbons .preventTransitions(r) .updateRibbonInPlace( + //.updateRibbon( gids, r_gid, // XXX this makes the animation of the ribbon @@ -157,8 +158,7 @@ var PartialRibbonsActions = actions.Actions({ // jumpy but does not touch the indicator // animation... target) - //.restoreTransitions(r, true) - .restoreTransitions(r) + .restoreTransitions(r, true) } }], }) diff --git a/ui (gen4)/imagegrid/ribbons.js b/ui (gen4)/imagegrid/ribbons.js index 40f0d379..0bc96754 100755 --- a/ui (gen4)/imagegrid/ribbons.js +++ b/ui (gen4)/imagegrid/ribbons.js @@ -1638,8 +1638,6 @@ 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) @@ -1667,10 +1665,24 @@ var RibbonsPrototype = { } // update gids... + var unload_marks = [] gids .slice(0, loaded.length) .forEach(function(gid, i){ - gid && that.setElemGID(loaded.eq(i), gid) }) + if(gid !== undefined){ + var img = loaded.eq(i) + + // cleanup marks... + var g = that.getElemGID(img) + unload_marks = gids.indexOf(g) < 0 ? + unload_marks.concat(that.getImageMarks(g).toArray()) + : unload_marks + + gid && that.setElemGID(img, gid) + } + }) + $(unload_marks) + .remove() // update images... this.updateImage(loaded)