minor tweaks and bugfixes...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2014-01-01 07:41:53 +04:00
parent f757f776ff
commit 9598d7ab7d
5 changed files with 32 additions and 13 deletions

View File

@ -57,6 +57,16 @@ var CONFIG = {
// Application name... // Application name...
app_name: 'ImageGrid.Viewer', 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... // Loader configuration...
// //
// load_screens // load_screens

View File

@ -6,8 +6,7 @@
//var DEBUG = DEBUG != null ? DEBUG : true //var DEBUG = DEBUG != null ? DEBUG : true
var STEPS_TO_CHANGE_DIRECTION = 2 var _STEPS_LEFT_TO_CHANGE_DIRECTION = CONFIG.steps_to_change_direction
var _STEPS_LEFT_TO_CHANGE_DIRECTION = STEPS_TO_CHANGE_DIRECTION
var DIRECTION = 'next' var DIRECTION = 'next'
@ -19,10 +18,10 @@ function updateDirection(direction){
_STEPS_LEFT_TO_CHANGE_DIRECTION-- _STEPS_LEFT_TO_CHANGE_DIRECTION--
if(_STEPS_LEFT_TO_CHANGE_DIRECTION == 0){ if(_STEPS_LEFT_TO_CHANGE_DIRECTION == 0){
DIRECTION = direction DIRECTION = direction
_STEPS_LEFT_TO_CHANGE_DIRECTION = 2 _STEPS_LEFT_TO_CHANGE_DIRECTION = CONFIG.steps_to_change_direction
} }
} else { } 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', title: 'Ribbon view',
Left: { Left: {
// XXX revise...
alt: doc('Shift image left', alt: doc('Shift image left',
function(){ function(){
event.preventDefault() event.preventDefault()
shiftImageLeft() shiftImageLeft()
centerView(null, 'css') centerView(null, 'css')
// XXX for some odd reason centerRibbons does // 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() //centerRibbons()
// XXX HACK... // 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){ if(window._center_ribbon_delay != null){
clearTimeout(_center_ribbon_delay) clearTimeout(_center_ribbon_delay)
} }
@ -317,18 +318,19 @@ var KEYBOARD_CONFIG = {
ctrl: 'prev-screen', ctrl: 'prev-screen',
}, },
Right: { Right: {
// XXX revise...
alt: doc('Shift image right', alt: doc('Shift image right',
function(){ function(){
event.preventDefault() event.preventDefault()
shiftImageRight() shiftImageRight()
centerView(null, 'css') centerView(null, 'css')
// XXX for some odd reason centerRibbons does // 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() //centerRibbons()
// XXX HACK... // 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){ if(window._center_ribbon_delay != null){
clearTimeout(_center_ribbon_delay) clearTimeout(_center_ribbon_delay)
} }

View File

@ -33,8 +33,14 @@ function _addMark(cls, gid, image){
mark = $('<div class="mark"/>') mark = $('<div class="mark"/>')
.addClass(gid) .addClass(gid)
.addClass(cls) .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 return mark
} }
function _removeMark(cls, gid, image){ function _removeMark(cls, gid, image){

View File

@ -1169,7 +1169,7 @@ function zoomOut(){
/************************************************** Editor Actions ***/ /************************************************** 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... // on data ordering...
function shiftImageTo(image, direction, moving, force_create_ribbon){ function shiftImageTo(image, direction, moving, force_create_ribbon){

View File

@ -1335,6 +1335,7 @@ function setupUI(viewer){
'focusingImage', 'focusingImage',
'fittingImages', 'fittingImages',
//'updatingImageProportions', //'updatingImageProportions',
'horizontalSiftedImage',
].join(' '), ].join(' '),
function(){ function(){
updateCurrentMarker() updateCurrentMarker()