several bugs fixed...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2016-07-03 18:53:02 +03:00
parent 2295c715e6
commit e1ddf12e7c
2 changed files with 12 additions and 7 deletions

View File

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

View File

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