moved the resize handler to a seporate function...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2013-01-27 01:25:20 +04:00
parent eb197ec6e2
commit 5994158f24
2 changed files with 16 additions and 14 deletions

View File

@ -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')

View File

@ -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