mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-11-03 21:00:14 +00:00
some cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
30e09dbec3
commit
188dc46c6d
83
ui/modes.js
83
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 $('<h1>Help</h1>')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user