summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2020-09-15 18:47:19 +0300
committerAndrew Dolgov <[email protected]>2020-09-15 18:47:19 +0300
commit42b5564d1e4c06b18e37071459e04f6fcd36a85a (patch)
treec59f108948e6ac7968e107fe5a1aa3d831ccbbd7 /js
parent0706a328a4e97152b745f902373cebbd4e0e6153 (diff)
editarticletags: load dialog via XHR
Diffstat (limited to 'js')
-rw-r--r--js/Article.js71
1 files changed, 37 insertions, 34 deletions
diff --git a/js/Article.js b/js/Article.js
index 174015a61..1fc5bc9ab 100644
--- a/js/Article.js
+++ b/js/Article.js
@@ -257,53 +257,56 @@ const Article = {
return false;
},
editTags: function (id) {
- const query = "backend.php?op=article&method=editArticleTags&param=" + encodeURIComponent(id);
-
if (dijit.byId("editTagsDlg"))
dijit.byId("editTagsDlg").destroyRecursive();
- const dialog = new dijit.Dialog({
- id: "editTagsDlg",
- title: __("Edit article Tags"),
- style: "width: 600px",
- execute: function () {
- if (this.validate()) {
- Notify.progress("Saving article tags...", true);
+ xhrPost("backend.php", {op: "article", method: "editarticletags", param: id}, (transport) => {
+
+ const dialog = new dijit.Dialog({
+ id: "editTagsDlg",
+ title: __("Edit article Tags"),
+ style: "width: 600px",
+ content: transport.responseText,
+ execute: function () {
+ if (this.validate()) {
+ Notify.progress("Saving article tags...", true);
- xhrPost("backend.php", this.attr('value'), (transport) => {
- try {
- Notify.close();
- dialog.hide();
+ xhrPost("backend.php", this.attr('value'), (transport) => {
+ try {
+ Notify.close();
+ dialog.hide();
- const data = JSON.parse(transport.responseText);
+ const data = JSON.parse(transport.responseText);
- if (data) {
- const id = data.id;
+ if (data) {
+ const id = data.id;
- const tags = $("ATSTR-" + id);
- const tooltip = dijit.byId("ATSTRTIP-" + id);
+ const tags = $("ATSTR-" + id);
+ const tooltip = dijit.byId("ATSTRTIP-" + id);
- if (tags) tags.innerHTML = data.content;
- if (tooltip) tooltip.attr('label', data.content_full);
+ if (tags) tags.innerHTML = data.content;
+ if (tooltip) tooltip.attr('label', data.content_full);
+ }
+ } catch (e) {
+ App.Error.report(e);
}
- } catch (e) {
- App.Error.report(e);
- }
- });
- }
- },
- href: query
- });
+ });
+ }
+ },
+ });
+
+ const tmph = dojo.connect(dialog, 'onLoad', function () {
+ dojo.disconnect(tmph);
+
+ new Ajax.Autocompleter('tags_str', 'tags_choices',
+ "backend.php?op=article&method=completeTags",
+ {tokens: ',', paramName: "search"});
+ });
- const tmph = dojo.connect(dialog, 'onLoad', function () {
- dojo.disconnect(tmph);
+ dialog.show();
- new Ajax.Autocompleter('tags_str', 'tags_choices',
- "backend.php?op=article&method=completeTags",
- {tokens: ',', paramName: "search"});
});
- dialog.show();
},
cdmMoveToId: function (id, params) {
params = params || {};