From 80ac4b03e1e3186dadf329deb442178790e2f1c5 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 9 Dec 2013 21:59:18 +0400 Subject: [PATCH] cleanup... Signed-off-by: Alex A. Naanou --- ui/ribbons.js | 23 ++++++++++++++++++----- ui/setup.js | 24 ------------------------ 2 files changed, 18 insertions(+), 29 deletions(-) diff --git a/ui/ribbons.js b/ui/ribbons.js index bb49c884..893d48c2 100755 --- a/ui/ribbons.js +++ b/ui/ribbons.js @@ -722,12 +722,25 @@ function centerRibbons(mode, no_skip_current, no_skip_hidden){ return } - // skip ribbons outside of the viewer... - // NOTE: we are accounting for position relative to image... - // NOTE: we need to factor in image height as the distance is - // between cleanly ribbon centers will mean that half - // hidden ribbons will not get updated... + // skip hidden ribbons... if(no_skip_hidden != true){ + /* NOTE: this is commented out as it is not really needed now + * uncomment if a need arises... + // skip ribbons that are not visible or are not displayed... + // NOTE: we do not make an attempt to test each and every + // way a ribbon can be hidden... + if(ribbon.css('visibility') == 'hidden' + || ribbon.css('display') == 'none' + || ribbon.css('opacity') == 0){ + return + } + */ + + // skip ribbons outside of the viewer... + // NOTE: we are accounting for position relative to image... + // NOTE: we need to factor in image height as the distance is + // between cleanly ribbon centers will mean that half + // hidden ribbons will not get updated... var d = Math.abs(getRelativeVisualPosition(cur, ribbon).top) if( d - h/2 >= R ){ return diff --git a/ui/setup.js b/ui/setup.js index 7a2db01d..dc028a49 100755 --- a/ui/setup.js +++ b/ui/setup.js @@ -95,30 +95,6 @@ function setupDataBindings(viewer){ return } - /* NOTE: this is not really needed as we are skipping this stuff - // in centerRibbons(...) - // skip the whole thing if the ribbon is not visible, i.e. outside - // of viewer area... - var R = $('.viewer').height()/2 - var h = image.height() - var d = Math.abs(getRelativeVisualPosition(image, ribbon).top) - if( d - h/2 >= R ){ - return - } - */ - - /* NOTE: this is commented out as it is not really needed now - * uncomment if a need arises... - // skip ribbons that are not visible or are not displayed... - // NOTE: we do not make an attempt to test each and every - // way a ribbon can be hidden... - if(ribbon.css('visibility') == 'hidden' - || ribbon.css('display') == 'none' - || ribbon.css('opacity') == 0){ - return - } - */ - // prepare for loading... var gid = getImageGID(image) var gr = DATA.ribbons[r]