From 5994158f2425d16d64d4874f35b7c2bdf84da8a6 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sun, 27 Jan 2013 01:25:20 +0400 Subject: [PATCH] moved the resize handler to a seporate function... Signed-off-by: Alex A. Naanou --- index.html | 15 +-------------- magazine.js | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/index.html b/index.html index f5c629d..23b20c9 100755 --- a/index.html +++ b/index.html @@ -26,20 +26,7 @@ $(document).ready(function(){ $(window) - .resize(function() { - // XXX might be good to compensate for document zoom... - if(document.width/$(document).width() != 1){ - // XXX scale the page... - console.log('>>> Page Zoom:', document.width/$(document).width()) - } - //$('.splash').show() - if(ANIMATE_WINDOW_RESIZE){ - updateView() - } else { - unanimated($('.scaler'), updateView, 30)() - } - //$('.splash').fadeOut() - }) + .resize(viewResizeHandler) .bind('hashchange', hashChangeHandler) $('.viewer') diff --git a/magazine.js b/magazine.js index 89bce23..11e6d4b 100755 --- a/magazine.js +++ b/magazine.js @@ -90,6 +90,21 @@ function hashChangeHandler(e){ } } +function viewResizeHandler(){ + // XXX might be good to compensate for document zoom... + if(document.width/$(document).width() != 1){ + // XXX scale the page... + console.log('>>> Page Zoom:', document.width/$(document).width()) + } + //$('.splash').show() + if(ANIMATE_WINDOW_RESIZE){ + updateView() + } else { + unanimated($('.scaler'), updateView, 30)() + } + //$('.splash').fadeOut() +} + // swipe state handler // this handles single and double finger swipes and dragging