diff --git a/ui/Gen3-TODO.otl b/ui/Gen3-TODO.otl index a8ad76d1..7f2efcd3 100755 --- a/ui/Gen3-TODO.otl +++ b/ui/Gen3-TODO.otl @@ -10,6 +10,9 @@ | [_] BUG: jumping screen images does not load the adjacent ribbons... | 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 [_] 33% cropping selection [X] marked diff --git a/ui/base.js b/ui/base.js index 7ca7b476..622b608b 100755 --- a/ui/base.js +++ b/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 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 // on direction... -function prevRibbon(moving, mode){ +function prevRibbon(mode){ mode = mode == null ? NAV_DEFAULT : mode var cur = $('.current.image') var target = getImageBefore(cur, getRibbon(cur).prevAll('.ribbon' + NAV_RIBBON_DEFAULT).first()) + + // first image... if(target.length == 0){ // XXX too complex??? target = getRibbon(cur) .prevAll('.ribbon' + NAV_RIBBON_DEFAULT).first() .find('.image' + mode).first() - } else if(moving == 'next' && cur.attr('order') != target.attr('order')){ + + } else { var next = target.nextAll('.image' + mode).first() target = next.length > 0 ? next : target } return centerView(focusImage(target)) } -function nextRibbon(moving, mode){ +function nextRibbon(mode){ mode = mode == null ? NAV_DEFAULT : mode var cur = $('.current.image') var target = getImageBefore(cur, getRibbon(cur).nextAll('.ribbon' + NAV_RIBBON_DEFAULT).first()) + + // first image... if(target.length == 0){ // XXX too complex??? target = getRibbon(cur) .nextAll('.ribbon' + NAV_RIBBON_DEFAULT).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)) } diff --git a/ui/keybindings3.js b/ui/keybindings3.js index 4dae385f..bb4abb27 100755 --- a/ui/keybindings3.js +++ b/ui/keybindings3.js @@ -88,7 +88,7 @@ var KEYBOARD_CONFIG = { Up: { default: function(){ event.preventDefault() - prevRibbon(DIRECTION) + prevRibbon() centerRibbons() }, shift: function(){ @@ -105,7 +105,7 @@ var KEYBOARD_CONFIG = { Down: { default: function(){ event.preventDefault() - nextRibbon(DIRECTION) + nextRibbon() centerRibbons() }, shift: function(){