From 58081e1f1657e5bb964206f9d21565d3e552eab0 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sat, 17 Aug 2013 16:32:33 +0200 Subject: [PATCH] fix text resize, edit title/redirect --- static/js/textPanel.js | 11 ++++++++--- static/js/utils.js | 5 ++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/static/js/textPanel.js b/static/js/textPanel.js index 496e4b27..edf042c5 100644 --- a/static/js/textPanel.js +++ b/static/js/textPanel.js @@ -240,7 +240,11 @@ pandora.ui.textHTML = function(text) { id: pandora.user.ui.text, name: data.value }, function(result) { - Ox.print('RESULT.DATA:', result.data); + if (result.data.id != pandora.user.ui.text) { + Ox.Request.clearCache(); + pandora.renameList(pandora.user.ui.text, result.data.id, result.data.name); + pandora.$ui.info.updateListInfo(); + } }); } }) @@ -287,7 +291,6 @@ pandora.ui.textHTML = function(text) { }) .bindEvent({ submit: function(data) { - Ox.print('SUBMIT', data.value); Ox.Request.clearCache('getText'); pandora.api.editText({ id: pandora.user.ui.text, @@ -308,13 +311,15 @@ pandora.ui.textHTML = function(text) { return window.innerWidth - pandora.user.ui.showSidebar * pandora.user.ui.sidebarSize - 1 - pandora.user.ui.embedSize - 1 - - 32; + - 32 - 16; } that.update = function() { $text.options({ maxHeight: getHeight(), width: getWidth() + }).css({ + width: getWidth() + 'px' }); return that; }; diff --git a/static/js/utils.js b/static/js/utils.js index ffd24016..8fa9bcbc 100644 --- a/static/js/utils.js +++ b/static/js/utils.js @@ -1901,6 +1901,9 @@ pandora.resizeFolders = function(section) { pandora.$ui.folder[pos].updatePanel(); } }); + if (pandora.user.ui.section == 'texts') { + pandora.$ui.text && pandora.$ui.text.update(); + } }; pandora.resizeWindow = function() { @@ -1981,7 +1984,7 @@ pandora.resizeWindow = function() { }); } } else if (pandora.user.ui.section == 'texts') { - // ... + pandora.$ui.text && pandora.$ui.text.update(); } };