From e1ddf12e7c7b23b8003d8f3411fdd096c7b7d833 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sun, 3 Jul 2016 18:53:02 +0300 Subject: [PATCH] several bugs fixed... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/ui.js | 11 ++++++++--- ui (gen4)/imagegrid/ribbons.js | 8 ++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/ui (gen4)/features/ui.js b/ui (gen4)/features/ui.js index 2fbf2923..c15085ad 100755 --- a/ui (gen4)/features/ui.js +++ b/ui (gen4)/features/ui.js @@ -44,7 +44,9 @@ function(force, callback){ var updateImagePosition = module.updateImagePosition = function updateImagePosition(actions, target){ - if(actions.ribbons.getRibbonSet().length == 0){ + var s = actions.ribbons.getRibbonSet() + + if(s.length == 0){ return } @@ -57,7 +59,7 @@ function updateImagePosition(actions, target){ var source_order = actions.data.getImageOrder(target) return function(){ - actions.ribbons.preventTransitions() + actions.ribbons.preventTransitions(s) // XXX hack... if(target.constructor === Array){ @@ -102,7 +104,10 @@ function updateImagePosition(actions, target){ actions.focusImage() - actions.ribbons.restoreTransitions(true) + // XXX not sure why this does not work without a setTimeout(..) + //actions.ribbons.restoreTransitions(s, true) + setTimeout(function(){ + actions.ribbons.restoreTransitions(s, true) }, 0) } } diff --git a/ui (gen4)/imagegrid/ribbons.js b/ui (gen4)/imagegrid/ribbons.js index 9c9293b2..37a1b4ad 100755 --- a/ui (gen4)/imagegrid/ribbons.js +++ b/ui (gen4)/imagegrid/ribbons.js @@ -366,10 +366,10 @@ var RibbonsPrototype = { // handle nesting... var l = t.getAttribute('__prevent_transitions') if(l != null){ - t.getAttribute('__prevent_transitions', l+1) + t.setAttribute('__prevent_transitions', parseInt(l)+1) return this } - t.getAttribute('__prevent_transitions', 0) + t.setAttribute('__prevent_transitions', 0) target.addClass('no-transitions') @@ -428,7 +428,7 @@ var RibbonsPrototype = { // handle nesting... var l = t.getAttribute('__prevent_transitions') if(l != null && !force && l != '0'){ - t.getAttribute('__prevent_transitions', l-1) + t.setAttribute('__prevent_transitions', parseInt(l)-1) return this } t.removeAttribute('__prevent_transitions') @@ -449,7 +449,7 @@ var RibbonsPrototype = { // handle nesting... var l = t.getAttribute('__prevent_transitions') if(l != null && !force && l != '0'){ - t.getAttribute('__prevent_transitions', l-1) + t.setAttribute('__prevent_transitions', l-1) return this } t.removeAttribute('__prevent_transitions')