mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-11-01 11:50:07 +00:00
fixed a minor bug with indicators...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
2df407f444
commit
9f231cb467
@ -52,11 +52,13 @@ function updateImagePosition(actions, target){
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// place image at position...
|
||||||
var to = actions.data.getImage(target, 'next')
|
var to = actions.data.getImage(target, 'next')
|
||||||
if(to != null){
|
if(to != null){
|
||||||
actions.ribbons.placeImage(target, to, 'before')
|
actions.ribbons.placeImage(target, to, 'before')
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
// place image after position...
|
||||||
to = actions.data.getImage(target, 'prev')
|
to = actions.data.getImage(target, 'prev')
|
||||||
if(to != null){
|
if(to != null){
|
||||||
actions.ribbons.placeImage(target, to, 'after')
|
actions.ribbons.placeImage(target, to, 'after')
|
||||||
@ -1189,21 +1191,23 @@ module.BoundsIndicators = Feature({
|
|||||||
.on('shiftImageUp.pre', tag,
|
.on('shiftImageUp.pre', tag,
|
||||||
function(target){
|
function(target){
|
||||||
target = target || this.current
|
target = target || this.current
|
||||||
var r0 = this.data.getRibbonOrder(target)
|
var r = this.data.getRibbonOrder(target)
|
||||||
var l = this.data.getImages(r0).length
|
var l = this.data.getImages(r).length
|
||||||
|
var l0 = this.data.getImages(0).length
|
||||||
|
|
||||||
return function(){
|
return function(){
|
||||||
var r1 = this.data.getRibbonOrder(target)
|
|
||||||
// when shifting last image of top ribbon (i.e. length == 1)
|
// when shifting last image of top ribbon (i.e. length == 1)
|
||||||
// up the state essentially will not change...
|
// up the state essentially will not change...
|
||||||
if(r0 == 0 && r1 == 0 && l == 1){
|
if((r == 0 && l == 1)
|
||||||
|
// we are shifting to a new empty ribbon...
|
||||||
|
|| (r == 1 && l == 1 && l0 == 0)){
|
||||||
that.flashIndicator(this.ribbons.viewer, 'top')
|
that.flashIndicator(this.ribbons.viewer, 'top')
|
||||||
} else {
|
} else {
|
||||||
that.flashIndicator(this.ribbons.viewer, 'up')
|
that.flashIndicator(this.ribbons.viewer, 'up')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.on('shiftimagedown.pre', tag,
|
.on('shiftImageDown.pre', tag,
|
||||||
function(target){
|
function(target){
|
||||||
target = target || this.current
|
target = target || this.current
|
||||||
var r0 = this.data.getRibbonOrder(target)
|
var r0 = this.data.getRibbonOrder(target)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user