diff --git a/ui/TODO.otl b/ui/TODO.otl index 187e3572..13f698a6 100755 --- a/ui/TODO.otl +++ b/ui/TODO.otl @@ -106,6 +106,7 @@ Roadmap [_] index and group ALL files in an archive [_] import metadata [_] real GIDs + [_] BUG: context status does not get updated on Ctrl-D [_] BUG: shifting last image out of a ribbon misaligns the current ribbon | i.e. the prev ribbon was deleted and the new focused ribbon | is aligned as if it was not current... diff --git a/ui/setup.js b/ui/setup.js index a5ce0c6c..86adc4e8 100755 --- a/ui/setup.js +++ b/ui/setup.js @@ -40,6 +40,19 @@ function setupIndicators(){ } +function updateContextIndicators(image){ + image = image == null ? getImage() : $(image) + + // marked... + var indicator = $('.context-mode-indicators .current-image-marked') + if(image.hasClass('marked')){ + indicator.addClass('shown') + } else { + indicator.removeClass('shown') + } +} + + // Setup event handlers for data bindings... // // This does two jobs: @@ -334,11 +347,18 @@ function setupDataBindings(viewer){ // info... .on([ 'focusingImage', + 'togglingMark' + ].join(' '), + function(evt, image){ + image = $(image) + updateGlobalImageInfo(image) + updateContextIndicators(image) + }) + .on([ 'rotatingLeft', 'rotateingRight', 'flippingVertical', - 'flippingHorizontal', - 'togglingMark' + 'flippingHorizontal' ].join(' '), function(evt, image){ updateGlobalImageInfo($(image)) @@ -352,19 +372,9 @@ function setupDataBindings(viewer){ ].join(' '), function(){ updateGlobalImageInfo() + updateContextIndicators() }) - // mark indicator... - // XXX make this generic and handle any of the available marks... - .on('focusingImage togglingMark', function(evt, image){ - image = image.length == 0 ? getImage() : image - var indicator = $('.context-mode-indicators .current-image-marked') - if(image.hasClass('marked')){ - indicator.addClass('shown') - } else { - indicator.removeClass('shown') - } - }) .on('baseURLChanged', function(evt, url){ saveLocalStorageBaseURL()