From 1ccae2ba1e3eea6326ca487a8e56832d86c511b8 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Tue, 29 Jan 2013 15:50:52 +0400 Subject: [PATCH] some refacoting... Signed-off-by: Alex A. Naanou --- index.html | 6 +++--- magazine.js | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/index.html b/index.html index 3610e65..a3c964f 100755 --- a/index.html +++ b/index.html @@ -420,7 +420,7 @@ $(document).ready(function(){ Drag in full page view:
- Enable different size pages (still flaky): + Enable different size pages (still flaky):

NOTE: this is not an actual configuration page, just a live demo @@ -439,14 +439,14 @@ $(document).ready(function(){ FIT_PAGE_TO_VIEW = $('#FIT_PAGE_TO_VIEW').text() == 'true' ? true : false ANIMATE_WINDOW_RESIZE = $('#ANIMATE_WINDOW_RESIZE').text() == 'true' ? true : false DRAG_FULL_PAGE = $('#DRAG_FULL_PAGE').text() == 'true' ? true : false - _USE_REAL_SIZES = $('#_USE_REAL_SIZES').text() == 'true' ? true : false + USE_REAL_PAGE_SIZES = $('#USE_REAL_PAGE_SIZES').text() == 'true' ? true : false } function loadSettings(){ $('#PAGES_IN_RIBBON').attr('value', PAGES_IN_RIBBON) $('#FIT_PAGE_TO_VIEW').text(FIT_PAGE_TO_VIEW) $('#ANIMATE_WINDOW_RESIZE').text(ANIMATE_WINDOW_RESIZE) $('#DRAG_FULL_PAGE').text(DRAG_FULL_PAGE) - $('#_USE_REAL_SIZES').text(_USE_REAL_SIZES) + $('#USE_REAL_PAGE_SIZES').text(USE_REAL_PAGE_SIZES) } function toggleSetting(obj){ obj = $(obj) diff --git a/magazine.js b/magazine.js index fc0f809..b9b40b1 100755 --- a/magazine.js +++ b/magazine.js @@ -23,8 +23,8 @@ var DRAG_FULL_PAGE = true // we get to the right from the no-resize element... // ...think the reason is .no-resize page centering... // XXX still buggy on togglePageView to TN after funny sized pages... -//var _USE_REAL_SIZES = true -var _USE_REAL_SIZES = false +//var USE_REAL_PAGE_SIZES = true +var USE_REAL_PAGE_SIZES = false /*********************************************************************/ @@ -203,7 +203,7 @@ function fitNPages(n, fit_to_content){ fit_to_content = true } var view = $('.viewer') - if(_USE_REAL_SIZES){ + if(USE_REAL_PAGE_SIZES){ var page = $('.page:not(.no-resize)') } else { var page = $('.page') @@ -223,7 +223,7 @@ function fitNPages(n, fit_to_content){ // this point, as we will start changing things next... if(fit_to_content){ - if(_USE_REAL_SIZES){ + if(USE_REAL_PAGE_SIZES){ page.width('auto') page.height('auto') } else { @@ -266,7 +266,7 @@ function fitNPages(n, fit_to_content){ var offset = rW * getPageNumber()-1 } else { // calculate the target offset... - if(_USE_REAL_SIZES){ + if(USE_REAL_PAGE_SIZES){ var rpages = $('.page:not(.no-resize), .current.page') } else { var rpages = page @@ -274,7 +274,7 @@ function fitNPages(n, fit_to_content){ var i = rpages.index(cur) var offset = rW * i-1 // now do the unresized elements... - if(_USE_REAL_SIZES){ + if(USE_REAL_PAGE_SIZES){ $('.page.no-resize').width('auto') var nrpages = $('.page.no-resize, .current.page') i = nrpages.index(cur) @@ -285,7 +285,7 @@ function fitNPages(n, fit_to_content){ } } - if(_USE_REAL_SIZES){ + if(USE_REAL_PAGE_SIZES){ if(cur.hasClass('no-resize')){ rW = cur.width() }