From 1dcb9095c946bf1e8c58d5299b29d3caa9952da5 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 28 Jan 2013 03:25:04 +0400 Subject: [PATCH] more playing with page sizes (still flaky)... Signed-off-by: Alex A. Naanou --- index.html | 12 ++++++------ magazine.css | 3 ++- magazine.js | 15 +++++++++++---- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/index.html b/index.html index 24eaf57..0f2b44e 100755 --- a/index.html +++ b/index.html @@ -299,18 +299,18 @@ $(document).ready(function(){ Page -
-
+
+
Page
-
-
+
+
Page
-
-
+
+
Page
diff --git a/magazine.css b/magazine.css index 63ff9a4..f788c38 100755 --- a/magazine.css +++ b/magazine.css @@ -27,6 +27,8 @@ body { text-align: left; overflow: hidden; + text-align: center; + width: auto; height: auto; /* XXX change to relative units... */ @@ -64,7 +66,6 @@ body { } .page-view-mode .page { - text-align: center; /* XXX change to relative units... */ width: 800px; diff --git a/magazine.js b/magazine.js index 90a7b29..13b7ced 100755 --- a/magazine.js +++ b/magazine.js @@ -22,8 +22,9 @@ var DRAG_FULL_PAGE = false // XXX this produces a funny animation that gets more ampletude the farther // we get to the right from the no-resize element... // ...think the reason is .no-resize page centering... -var _USE_REAL_SIZES = true -//var _USE_REAL_SIZES = false +// XXX still buggy on togglePageView to TN after funny sized pages... +//var _USE_REAL_SIZES = true +var _USE_REAL_SIZES = false /*********************************************************************/ @@ -219,8 +220,13 @@ function fitNPages(n, fit_to_content){ // this point, as we will start changing things next... if(fit_to_content){ - page.width(cW) - page.height(cH) + if(_USE_REAL_SIZES){ + page.width('auto') + page.height('auto') + } else { + page.width(cW) + page.height(cH) + } if(W/H > (cW*n)/cH){ scale = H/cH } else { @@ -266,6 +272,7 @@ function fitNPages(n, fit_to_content){ var offset = rW * i-1 // now do the unresized elements... if(_USE_REAL_SIZES){ + $('.page.no-resize').width('auto') var nrpages = $('.page.no-resize, .current.page') i = nrpages.index(cur) nrpages.splice(i)