From 4f5bb21a214859e596c407335976fdcbf527540a Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 7 Aug 2013 15:25:13 +0000 Subject: [PATCH] update UI and URL controllers (text position) --- static/js/UI.js | 9 +++++++++ static/js/URL.js | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/static/js/UI.js b/static/js/UI.js index 756c706ad..128681eca 100644 --- a/static/js/UI.js +++ b/static/js/UI.js @@ -40,6 +40,7 @@ pandora.UI = (function() { listSettings = pandora.site.listSettings, listView, set = {}, + textSettings = pandora.site.textSettings, trigger = {}, triggerEvents; @@ -170,6 +171,14 @@ pandora.UI = (function() { : value; }); } + if (args.text) { + add['texts.' + that.encode(args.text)] = Ox.map(textSettings, function(value, key) { + var textsKey = 'texts.' + that.encode(args.text) + '.' + key; + return textsKey in args ? args[editextsKeytsKey] + : pandora.user.ui.texts[args.text] ? pandora.user.ui.texts[args.text][key] + : value; + }); + } // items in args trigger events, items in add do not [args, add].forEach(function(obj, isAdd) { diff --git a/static/js/URL.js b/static/js/URL.js index dbb7e18dd..4783b6bd1 100644 --- a/static/js/URL.js +++ b/static/js/URL.js @@ -65,7 +65,9 @@ pandora.URL = (function() { : [] ); } else if (pandora.user.ui.section == 'texts') { - var position = pandora.user.ui.texts[pandora.user.ui.text].position; + var position = pandora.user.ui.texts[state.text] + ? pandora.user.ui.texts[state.text].position + : 0; if (position) { state.span = position; }