From 0b3ad6d5b4d3f0e43615bbe126c2f5641c8339a5 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 6 Aug 2012 16:24:20 +0400 Subject: [PATCH] minor refactoring... Signed-off-by: Alex A. Naanou --- ui/fullscreen.html | 3 +-- ui/gallery-prototype.js | 18 +++++++----------- ui/gallery.html | 3 +-- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/ui/fullscreen.html b/ui/fullscreen.html index 5dfc4a4e..ab1804d7 100755 --- a/ui/fullscreen.html +++ b/ui/fullscreen.html @@ -51,8 +51,7 @@ function setup(){ setBackgroundMode('dark') // setup event handlers... - setupKeyboard() - setupGestures() + setupEvents() setupControlElements() // XXX diff --git a/ui/gallery-prototype.js b/ui/gallery-prototype.js index d0b65e30..7a495c59 100755 --- a/ui/gallery-prototype.js +++ b/ui/gallery-prototype.js @@ -76,23 +76,19 @@ function setDefaultInitialState(){ if($('.current.image').length == 0){ $('.current.ribbon').children('.image').first().addClass('current') } +} + + +function setupEvents(){ + // resize... $(window).resize(function() { // XXX HACK $('.current.image').click() }) - -} - - - -function setupKeyboard(){ + // keyboard... $(document) .keydown(handleKeys) -} - - - -function setupGestures(){ + // swipe... $('.viewer') .swipe({ swipeLeft: nextImage, diff --git a/ui/gallery.html b/ui/gallery.html index a50f42ef..ce791113 100755 --- a/ui/gallery.html +++ b/ui/gallery.html @@ -48,8 +48,7 @@ function setup(){ setBackgroundMode('dark') // setup event handlers... - setupKeyboard() - setupGestures() + setupEvents() setupControlElements() // XXX