mirror of
https://github.com/flarum/core.git
synced 2025-08-18 06:11:23 +02:00
Extract edit tag submit data for extensibility
This commit is contained in:
19
extensions/tags/js/admin/dist/extension.js
vendored
19
extensions/tags/js/admin/dist/extension.js
vendored
@@ -768,6 +768,17 @@ System.register('flarum/tags/components/EditTagModal', ['flarum/components/Modal
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
key: 'submitData',
|
||||||
|
value: function submitData() {
|
||||||
|
return {
|
||||||
|
name: this.name(),
|
||||||
|
slug: this.slug(),
|
||||||
|
description: this.description(),
|
||||||
|
color: this.color(),
|
||||||
|
isHidden: this.isHidden()
|
||||||
|
};
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
key: 'onsubmit',
|
key: 'onsubmit',
|
||||||
value: function onsubmit(e) {
|
value: function onsubmit(e) {
|
||||||
@@ -777,13 +788,7 @@ System.register('flarum/tags/components/EditTagModal', ['flarum/components/Modal
|
|||||||
|
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
|
||||||
this.tag.save({
|
this.tag.save(this.submitData()).then(function () {
|
||||||
name: this.name(),
|
|
||||||
slug: this.slug(),
|
|
||||||
description: this.description(),
|
|
||||||
color: this.color(),
|
|
||||||
isHidden: this.isHidden()
|
|
||||||
}).then(function () {
|
|
||||||
return _this3.hide();
|
return _this3.hide();
|
||||||
}, function (response) {
|
}, function (response) {
|
||||||
_this3.loading = false;
|
_this3.loading = false;
|
||||||
|
@@ -88,18 +88,22 @@ export default class EditTagModal extends Modal {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
onsubmit(e) {
|
submitData() {
|
||||||
e.preventDefault();
|
return {
|
||||||
|
|
||||||
this.loading = true;
|
|
||||||
|
|
||||||
this.tag.save({
|
|
||||||
name: this.name(),
|
name: this.name(),
|
||||||
slug: this.slug(),
|
slug: this.slug(),
|
||||||
description: this.description(),
|
description: this.description(),
|
||||||
color: this.color(),
|
color: this.color(),
|
||||||
isHidden: this.isHidden()
|
isHidden: this.isHidden()
|
||||||
}).then(
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
onsubmit(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
this.loading = true;
|
||||||
|
|
||||||
|
this.tag.save(this.submitData()).then(
|
||||||
() => this.hide(),
|
() => this.hide(),
|
||||||
response => {
|
response => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
Reference in New Issue
Block a user