mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +00:00
made next/prev ribbon actions behave in a stable manner...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
c7a820d9c7
commit
9f291331b0
@ -10,6 +10,9 @@
|
|||||||
|
|
|
|
||||||
[_] BUG: jumping screen images does not load the adjacent ribbons...
|
[_] BUG: jumping screen images does not load the adjacent ribbons...
|
||||||
| positioning is OK but ribbons are not fully visible...
|
| positioning is OK but ribbons are not fully visible...
|
||||||
|
[_] make focus up/down chose a closest independently of direction...
|
||||||
|
| navigation should be stable and moving up then down should yield
|
||||||
|
| exactly the same result...
|
||||||
[_] 6% mark-based operations
|
[_] 6% mark-based operations
|
||||||
[_] 33% cropping selection
|
[_] 33% cropping selection
|
||||||
[X] marked
|
[X] marked
|
||||||
|
|||||||
16
ui/base.js
16
ui/base.js
@ -743,39 +743,39 @@ function lastImage(mode){
|
|||||||
|
|
||||||
// NOTE: if moving is 'next' these will chose the image after the current's order.
|
// NOTE: if moving is 'next' these will chose the image after the current's order.
|
||||||
// NOTE: if an image with the same order is found, moving argument has no effect.
|
// NOTE: if an image with the same order is found, moving argument has no effect.
|
||||||
// XXX make these select the closest image instead of the one based on
|
|
||||||
// direction...
|
|
||||||
// XXX these sometimes behave wrong at the start of the ribbon depending
|
// XXX these sometimes behave wrong at the start of the ribbon depending
|
||||||
// on direction...
|
// on direction...
|
||||||
function prevRibbon(moving, mode){
|
function prevRibbon(mode){
|
||||||
mode = mode == null ? NAV_DEFAULT : mode
|
mode = mode == null ? NAV_DEFAULT : mode
|
||||||
var cur = $('.current.image')
|
var cur = $('.current.image')
|
||||||
var target = getImageBefore(cur,
|
var target = getImageBefore(cur,
|
||||||
getRibbon(cur).prevAll('.ribbon' + NAV_RIBBON_DEFAULT).first())
|
getRibbon(cur).prevAll('.ribbon' + NAV_RIBBON_DEFAULT).first())
|
||||||
|
|
||||||
|
// first image...
|
||||||
if(target.length == 0){
|
if(target.length == 0){
|
||||||
// XXX too complex???
|
// XXX too complex???
|
||||||
target = getRibbon(cur)
|
target = getRibbon(cur)
|
||||||
.prevAll('.ribbon' + NAV_RIBBON_DEFAULT).first()
|
.prevAll('.ribbon' + NAV_RIBBON_DEFAULT).first()
|
||||||
.find('.image' + mode).first()
|
.find('.image' + mode).first()
|
||||||
} else if(moving == 'next' && cur.attr('order') != target.attr('order')){
|
|
||||||
|
} else {
|
||||||
var next = target.nextAll('.image' + mode).first()
|
var next = target.nextAll('.image' + mode).first()
|
||||||
target = next.length > 0 ? next : target
|
target = next.length > 0 ? next : target
|
||||||
}
|
}
|
||||||
return centerView(focusImage(target))
|
return centerView(focusImage(target))
|
||||||
}
|
}
|
||||||
function nextRibbon(moving, mode){
|
function nextRibbon(mode){
|
||||||
mode = mode == null ? NAV_DEFAULT : mode
|
mode = mode == null ? NAV_DEFAULT : mode
|
||||||
var cur = $('.current.image')
|
var cur = $('.current.image')
|
||||||
var target = getImageBefore(cur,
|
var target = getImageBefore(cur,
|
||||||
getRibbon(cur).nextAll('.ribbon' + NAV_RIBBON_DEFAULT).first())
|
getRibbon(cur).nextAll('.ribbon' + NAV_RIBBON_DEFAULT).first())
|
||||||
|
|
||||||
|
// first image...
|
||||||
if(target.length == 0){
|
if(target.length == 0){
|
||||||
// XXX too complex???
|
// XXX too complex???
|
||||||
target = getRibbon(cur)
|
target = getRibbon(cur)
|
||||||
.nextAll('.ribbon' + NAV_RIBBON_DEFAULT).first()
|
.nextAll('.ribbon' + NAV_RIBBON_DEFAULT).first()
|
||||||
.find('.image' + mode).first()
|
.find('.image' + mode).first()
|
||||||
} else if(moving == 'next' && cur.attr('order') != target.attr('order')){
|
|
||||||
var next = target.nextAll('.image' + mode).first()
|
|
||||||
target = next.length > 0 ? next : target
|
|
||||||
}
|
}
|
||||||
return centerView(focusImage(target))
|
return centerView(focusImage(target))
|
||||||
}
|
}
|
||||||
|
|||||||
@ -88,7 +88,7 @@ var KEYBOARD_CONFIG = {
|
|||||||
Up: {
|
Up: {
|
||||||
default: function(){
|
default: function(){
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
prevRibbon(DIRECTION)
|
prevRibbon()
|
||||||
centerRibbons()
|
centerRibbons()
|
||||||
},
|
},
|
||||||
shift: function(){
|
shift: function(){
|
||||||
@ -105,7 +105,7 @@ var KEYBOARD_CONFIG = {
|
|||||||
Down: {
|
Down: {
|
||||||
default: function(){
|
default: function(){
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
nextRibbon(DIRECTION)
|
nextRibbon()
|
||||||
centerRibbons()
|
centerRibbons()
|
||||||
},
|
},
|
||||||
shift: function(){
|
shift: function(){
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user