From 188dc46c6d9f06d754f6f047eb5f6df61238f294 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sun, 2 Jun 2013 02:57:25 +0400 Subject: [PATCH] some cleanup... Signed-off-by: Alex A. Naanou --- ui/modes.js | 83 ----------------------------------------------------- 1 file changed, 83 deletions(-) diff --git a/ui/modes.js b/ui/modes.js index 73f7dd2d..d10e0068 100755 --- a/ui/modes.js +++ b/ui/modes.js @@ -300,89 +300,6 @@ function toggleImageProportions(mode){ } -/* -// XXX make this generic, so as to add other UI renderers... -var toggleKeyboardHelp = createCSSClassToggler('.viewer', 'help-mode overlay', - function(action){ - var body = $(document.body) - var win = $(window) - - // on... - if(action == 'on'){ - // remove helo when we scroll to the top... - var scroll_handler = function(){ - if(body.scrollTop() <= 0){ - toggleKeyboardHelp('off') - } - } - - // prepare and cleanup... - $('.keyboard-help').remove() - $('.viewer').addClass('overlay') - - // build the help... - var doc = buildKeybindingsHelpHTML(KEYBOARD_CONFIG) - .on('click', function(){ - event.stopImmediatePropagation() - return false - }) - .css({ - cursor: 'auto', - }) - .appendTo(body) - - // add exit by click... - body - .one('click', function(){ - toggleKeyboardHelp('off') - }) - .css({ - cursor: 'hand', - }) - - // scroll to the help... - // NOTE: need to set the scroll handler AFTER we - // scroll down, or it will be more of a - // tease than a help... - var t = getRelativeVisualPosition($('.viewer'), doc).top - body - .animate({ - scrollTop: Math.abs(t) - 40, - }, function(){ - win - .on('scroll', scroll_handler) - }) - - // off... - } else { - // things to cleanup... - var _cleanup = function(){ - $('.keyboard-help').remove() - $('.viewer').removeClass('overlay') - body.click() - win.off('scroll', scroll_handler) - } - - // animate things if we are not at the top... - if(body.scrollTop() > 0){ - body - .css({ - cursor: '', - }) - .animate({ - scrollTop: 0, - }, _cleanup) - - // if we are at the top do things fast... - } else { - _cleanup() - } - } - }) -*/ - - - var toggleHelp = makeDrawerToggler( function(){ return $('

Help

')