diff options
author | Andrew Dolgov <[email protected]> | 2013-04-01 11:14:27 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-04-01 11:14:27 +0400 |
commit | 1c9bda915bb8a734af27cc3a2d2dd1cc16f2d5fd (patch) | |
tree | 5d9244ab519b3611f0f1f411af50728a3f83a61d /js/viewfeed.js | |
parent | a7edcc5585b5d2995c4ea033c242bb42ce95ca78 (diff) |
move several methods from dlg; fix displayed tags not updated after editing
Diffstat (limited to 'js/viewfeed.js')
-rw-r--r-- | js/viewfeed.js | 27 |
1 files changed, 15 insertions, 12 deletions
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); } }}); |