From 1c9bda915bb8a734af27cc3a2d2dd1cc16f2d5fd Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 1 Apr 2013 11:14:27 +0400 Subject: move several methods from dlg; fix displayed tags not updated after editing --- js/viewfeed.js | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'js/viewfeed.js') diff --git a/js/viewfeed.js b/js/viewfeed.js index a163dda21..c24dec62e 100644 --- a/js/viewfeed.js +++ b/js/viewfeed.js @@ -1067,7 +1067,7 @@ function catchupSelection() { } function editArticleTags(id) { - var query = "backend.php?op=dlg&method=editArticleTags¶m=" + param_escape(id); + var query = "backend.php?op=article&method=editArticleTags¶m=" + param_escape(id); if (dijit.byId("editTagsDlg")) dijit.byId("editTagsDlg").destroyRecursive(); @@ -1085,22 +1085,25 @@ function editArticleTags(id) { new Ajax.Request("backend.php", { parameters: query, onComplete: function(transport) { - notify(''); - dialog.hide(); + try { + notify(''); + dialog.hide(); - var data = JSON.parse(transport.responseText); + var data = JSON.parse(transport.responseText); - if (data) { - var tags_str = article.tags; - var id = tags_str.id; + if (data) { + var id = data.id; - var tags = $("ATSTR-" + id); - var tooltip = dijit.byId("ATSTRTIP-" + id); + console.log(id); - if (tags) tags.innerHTML = tags_str.content; - if (tooltip) tooltip.attr('label', tags_str.content_full); + var tags = $("ATSTR-" + id); + var tooltip = dijit.byId("ATSTRTIP-" + id); - cache_delete("article:" + id); + if (tags) tags.innerHTML = data.content; + if (tooltip) tooltip.attr('label', data.content_full); + } + } catch (e) { + exception_error("editArticleTags/inner", e); } }}); -- cgit v1.2.3