bugfix...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2014-11-02 03:35:26 +03:00
parent 741b3db47e
commit 2df407f444
2 changed files with 22 additions and 4 deletions

View File

@ -708,6 +708,7 @@ module.RibbonsPrototype = {
mode = mode == null ? 'before' : mode
var img = this.getImage(target)
img = img.length == 0 ? this.createImage(target) : img
var i = this.getImage(to)
var r = this.getRibbon(to)
// offset on same ribbon...
@ -726,7 +727,7 @@ module.RibbonsPrototype = {
}
// append/prepend to ribbon...
} else if(r.length > 0 && r.hasClass('ribbon')){
} else if(i.length == 0 && r.length > 0 && r.hasClass('ribbon')){
if(mode == 'before'){
r.append(img)
} else {

View File

@ -33,7 +33,9 @@ function reloadAfter(transitions){
var updateImagePosition =
module.updateImagePosition =
function updateImagePosition(actions, target){
target = target instanceof jQuery ? actions.ribbons.getElemGID(target) : target
target = target instanceof jQuery
? actions.ribbons.getElemGID(target)
: target
target = target || actions.current
var source_ribbon = actions.ribbons.getElemGID(actions.ribbons.getRibbon(target))
@ -960,6 +962,7 @@ function Feature(obj){
//---------------------------------------------------------------------
// NOTE: this is split out to an action so as to enable ui elements to
// adapt to ribbon size changes...
var PartialRibbonsActions =
@ -1022,7 +1025,6 @@ actions.Actions({
}]
})
// NOTE: I do not fully understand it yet, but PartialRibbons must be
// setup BEFORE RibbonAlignToFirst, otherwise the later will break
// on shifting an image to a new ribbon...
@ -1062,6 +1064,8 @@ module.PartialRibbons = Feature({
})
//---------------------------------------------------------------------
// XXX this should also define up/down navigation behavior e.g. what to
// focus on next/prev ribbon...
var AlignRibbonsToImageOrder =
@ -1080,6 +1084,8 @@ module.AlignRibbonsToImageOrder = Feature({
})
//---------------------------------------------------------------------
var AlignRibbonsToFirstImage =
module.AlignRibbonsToFirstImage = Feature({
tag: 'ui-ribbon-align-to-first',
@ -1096,6 +1102,8 @@ module.AlignRibbonsToFirstImage = Feature({
})
//---------------------------------------------------------------------
var ShiftAnimation =
module.ShiftAnimation = Feature({
tag: 'ui-animation',
@ -1121,6 +1129,8 @@ module.ShiftAnimation = Feature({
})
//---------------------------------------------------------------------
var BoundsIndicators =
module.BoundsIndicators = Feature({
tag: 'ui-bounds-indicators',
@ -1193,7 +1203,7 @@ module.BoundsIndicators = Feature({
}
}
})
.on('shiftImageDown.pre', tag,
.on('shiftimagedown.pre', tag,
function(target){
target = target || this.current
var r0 = this.data.getRibbonOrder(target)
@ -1233,6 +1243,8 @@ module.BoundsIndicators = Feature({
})
//---------------------------------------------------------------------
var CurrentImageIndicator =
module.CurrentImageIndicator = Feature({
tag: 'ui-current-image-indicator',
@ -1326,6 +1338,8 @@ module.CurrentImageIndicator = Feature({
})
//---------------------------------------------------------------------
// XXX
var ImageStateIndicator =
module.ImageStateIndicator = Feature({
@ -1341,6 +1355,7 @@ module.ImageStateIndicator = Feature({
//---------------------------------------------------------------------
// XXX
var GlobalStateIndicator =
module.GlobalStateIndicator = Feature({
@ -1355,6 +1370,8 @@ module.GlobalStateIndicator = Feature({
})
//---------------------------------------------------------------------
// XXX console / log / status bar