diff --git a/ui/data.js b/ui/data.js index 98767f1d..eed1c543 100755 --- a/ui/data.js +++ b/ui/data.js @@ -57,6 +57,16 @@ var CONFIG = { // Application name... app_name: 'ImageGrid.Viewer', + // Navigation... + // + // The number of moves after which the default direction will be + // changed... + // + // This affects: + // - default direction to focus after current image is shifted + // - default direction of the slideshow + steps_to_change_direction: 2, + // Loader configuration... // // load_screens diff --git a/ui/keybindings.js b/ui/keybindings.js index d66bc8d1..a87b5019 100755 --- a/ui/keybindings.js +++ b/ui/keybindings.js @@ -6,8 +6,7 @@ //var DEBUG = DEBUG != null ? DEBUG : true -var STEPS_TO_CHANGE_DIRECTION = 2 -var _STEPS_LEFT_TO_CHANGE_DIRECTION = STEPS_TO_CHANGE_DIRECTION +var _STEPS_LEFT_TO_CHANGE_DIRECTION = CONFIG.steps_to_change_direction var DIRECTION = 'next' @@ -19,10 +18,10 @@ function updateDirection(direction){ _STEPS_LEFT_TO_CHANGE_DIRECTION-- if(_STEPS_LEFT_TO_CHANGE_DIRECTION == 0){ DIRECTION = direction - _STEPS_LEFT_TO_CHANGE_DIRECTION = 2 + _STEPS_LEFT_TO_CHANGE_DIRECTION = CONFIG.steps_to_change_direction } } else { - _STEPS_LEFT_TO_CHANGE_DIRECTION = 2 + _STEPS_LEFT_TO_CHANGE_DIRECTION = CONFIG.steps_to_change_direction } } @@ -293,17 +292,19 @@ var KEYBOARD_CONFIG = { title: 'Ribbon view', Left: { + // XXX revise... alt: doc('Shift image left', function(){ event.preventDefault() shiftImageLeft() centerView(null, 'css') // XXX for some odd reason centerRibbons does - // something really odd here... + // something really odd here -- images get to + // correct positions but the align is totally + // wrong... + // ...race condition??? //centerRibbons() // XXX HACK... - // XXX this still gets misaligned sometimes but this - // is likely due to one of the align bugs if(window._center_ribbon_delay != null){ clearTimeout(_center_ribbon_delay) } @@ -317,18 +318,19 @@ var KEYBOARD_CONFIG = { ctrl: 'prev-screen', }, Right: { + // XXX revise... alt: doc('Shift image right', function(){ event.preventDefault() shiftImageRight() centerView(null, 'css') // XXX for some odd reason centerRibbons does - // something really odd here... + // something really odd here -- images get to + // correct positions but the align is totally + // wrong... + // ...race condition??? //centerRibbons() // XXX HACK... - // XXX this still gets misaligned sometimes but this - // is likely due to one of the align bugs - // (see: TODO.otl) if(window._center_ribbon_delay != null){ clearTimeout(_center_ribbon_delay) } diff --git a/ui/marks.js b/ui/marks.js index dd540a0b..6ae6fd51 100755 --- a/ui/marks.js +++ b/ui/marks.js @@ -33,8 +33,14 @@ function _addMark(cls, gid, image){ mark = $('
') .addClass(gid) .addClass(cls) - .insertAfter(image) + //.insertAfter(image) } + + // make sure the mark is explicitly after the image... + // XXX think of an eficient way to test if we need to re-insert... + mark + .insertAfter(image) + return mark } function _removeMark(cls, gid, image){ diff --git a/ui/ribbons.js b/ui/ribbons.js index 04f11910..ff7ac901 100755 --- a/ui/ribbons.js +++ b/ui/ribbons.js @@ -1169,7 +1169,7 @@ function zoomOut(){ /************************************************** Editor Actions ***/ -// NOTE: for shiftImageRight/shiftImageLeft see data.js, as they depend +// NOTE: for shiftImageRight/shiftImageLeft see sort.js, as they depend // on data ordering... function shiftImageTo(image, direction, moving, force_create_ribbon){ diff --git a/ui/ui.js b/ui/ui.js index 1761c192..1b066cb2 100755 --- a/ui/ui.js +++ b/ui/ui.js @@ -1335,6 +1335,7 @@ function setupUI(viewer){ 'focusingImage', 'fittingImages', //'updatingImageProportions', + 'horizontalSiftedImage', ].join(' '), function(){ updateCurrentMarker()