mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 00:01:24 +08:00
Fix more deprecations:
- Remove all `needs:` code
This commit is contained in:
@ -33,7 +33,7 @@ export default Ember.Controller.extend(activeSections, {
|
||||
return !this.get('model.changed') || this.get('model.isSaving');
|
||||
}.property('model.changed', 'model.isSaving'),
|
||||
|
||||
needs: ['adminCustomizeCssHtml'],
|
||||
adminCustomizeCssHtml: Ember.inject.controller(),
|
||||
|
||||
undoPreviewUrl: url('/?preview-style='),
|
||||
defaultStyleUrl: url('/?preview-style=default'),
|
||||
@ -44,13 +44,12 @@ export default Ember.Controller.extend(activeSections, {
|
||||
},
|
||||
|
||||
destroy() {
|
||||
const self = this;
|
||||
return bootbox.confirm(I18n.t("admin.customize.delete_confirm"), I18n.t("no_value"), I18n.t("yes_value"), function(result) {
|
||||
return bootbox.confirm(I18n.t("admin.customize.delete_confirm"), I18n.t("no_value"), I18n.t("yes_value"), result => {
|
||||
if (result) {
|
||||
const model = self.get('model');
|
||||
model.destroyRecord().then(function() {
|
||||
self.get('controllers.adminCustomizeCssHtml').get('model').removeObject(model);
|
||||
self.transitionToRoute('adminCustomizeCssHtml');
|
||||
const model = this.get('model');
|
||||
model.destroyRecord().then(() => {
|
||||
this.get('adminCustomizeCssHtml').get('model').removeObject(model);
|
||||
this.transitionToRoute('adminCustomizeCssHtml');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user