From 668368ea351e28f5b989127bb62fe0d85358cd04 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Mon, 17 Feb 2014 12:59:32 +0000 Subject: [PATCH] keep list/edit/text settings on rename, fixes #1264 and #2228 --- static/js/utils.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/static/js/utils.js b/static/js/utils.js index 4734bb06..b055eee1 100644 --- a/static/js/utils.js +++ b/static/js/utils.js @@ -2000,15 +2000,21 @@ pandora.renameList = function(oldId, newId, newName, folder) { // fixme: ugly // ... does this always coincide with triggerEvents = false, as below? pandora.replaceURL = true; + pandora.UI.set('lists.' + pandora.UI.encode(newId), pandora.user.ui.lists[oldId], false); pandora.UI.set({ find: { conditions: [{key: 'list', value: newId, operator: '=='}], operator: '&' } }, false); + pandora.UI.set('lists.' + pandora.UI.encode(oldId), null, false); + } else { pandora.replaceURL = true; + pandora.UI.set(pandora.user.ui.section + '.' + pandora.UI.encode(newId), + pandora.user.ui[pandora.user.ui.section][oldId], false); pandora.UI.set(pandora.user.ui.section.slice(0, -1), newId); + pandora.UI.set(pandora.user.ui.section + '.' + pandora.UI.encode(oldId), null, false); } };