minor refactoring...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2012-08-06 16:24:20 +04:00
parent ecf8a762ff
commit 0b3ad6d5b4
3 changed files with 9 additions and 15 deletions

View File

@ -51,8 +51,7 @@ function setup(){
setBackgroundMode('dark') setBackgroundMode('dark')
// setup event handlers... // setup event handlers...
setupKeyboard() setupEvents()
setupGestures()
setupControlElements() setupControlElements()
// XXX // XXX

View File

@ -76,23 +76,19 @@ function setDefaultInitialState(){
if($('.current.image').length == 0){ if($('.current.image').length == 0){
$('.current.ribbon').children('.image').first().addClass('current') $('.current.ribbon').children('.image').first().addClass('current')
} }
}
function setupEvents(){
// resize...
$(window).resize(function() { $(window).resize(function() {
// XXX HACK // XXX HACK
$('.current.image').click() $('.current.image').click()
}) })
// keyboard...
}
function setupKeyboard(){
$(document) $(document)
.keydown(handleKeys) .keydown(handleKeys)
} // swipe...
function setupGestures(){
$('.viewer') $('.viewer')
.swipe({ .swipe({
swipeLeft: nextImage, swipeLeft: nextImage,

View File

@ -48,8 +48,7 @@ function setup(){
setBackgroundMode('dark') setBackgroundMode('dark')
// setup event handlers... // setup event handlers...
setupKeyboard() setupEvents()
setupGestures()
setupControlElements() setupControlElements()
// XXX // XXX