From 01a6faed0d1eb406ec59bf531bd9b083c1528aaf Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Wed, 18 Sep 2013 15:41:45 +0000 Subject: [PATCH] user.ui.texts.id.position shoul always be int --- static/js/URL.js | 4 ++-- static/js/textPanel.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/static/js/URL.js b/static/js/URL.js index e166cbee..6a37f0bb 100644 --- a/static/js/URL.js +++ b/static/js/URL.js @@ -69,7 +69,7 @@ pandora.URL = (function() { ? pandora.user.ui.texts[state.item].position : 0; if (position) { - state.span = position; + state.span = [position]; } } @@ -217,7 +217,7 @@ pandora.URL = (function() { } else if (state.type == 'texts') { if (state.span) { - set['texts.' + pandora.UI.encode(state.item) + '.position'] = state.span; + set['texts.' + pandora.UI.encode(state.item) + '.position'] = state.span[0]; } } diff --git a/static/js/textPanel.js b/static/js/textPanel.js index a9619cec..abdedb68 100644 --- a/static/js/textPanel.js +++ b/static/js/textPanel.js @@ -222,7 +222,7 @@ pandora.ui.textHTML = function(text) { if (position != pandora.user.ui.texts[pandora.user.ui.text].position) { pandora.UI.set( 'texts.' + pandora.UI.encode(pandora.user.ui.text) + '.position', - position ? [position] : 0 + position ? position : 0 ); } } @@ -384,7 +384,7 @@ pandora.ui.textPDF = function(text) { }); }).open(); } else if (event == 'page') { - pandora.UI.set('texts.' + pandora.UI.encode(pandora.user.ui.text) + '.position', [data.page]); + pandora.UI.set('texts.' + pandora.UI.encode(pandora.user.ui.text) + '.position', data.page); } }) .appendTo(that);