mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 01:21:23 +08:00
REFACTOR: support booting discourse with DISCOURSE_NO_CONSTANTS
This change is discussed here: https://meta.discourse.org/t/deprecating-es6-compatibility-layer/35821 Prior to this change we were not booting correctly with DISCOURSE_NO_CONSTANTS
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
import Permalink from 'admin/models/permalink';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
classNames: ['permalink-form'],
|
||||
formSubmitted: false,
|
||||
@ -21,12 +23,12 @@ export default Ember.Component.extend({
|
||||
if (!this.get('formSubmitted')) {
|
||||
const self = this;
|
||||
self.set('formSubmitted', true);
|
||||
const permalink = Discourse.Permalink.create({url: self.get('url'), permalink_type: self.get('permalinkType'), permalink_type_value: self.get('permalink_type_value')});
|
||||
const permalink = Permalink.create({url: self.get('url'), permalink_type: self.get('permalinkType'), permalink_type_value: self.get('permalink_type_value')});
|
||||
permalink.save().then(function(result) {
|
||||
self.set('url', '');
|
||||
self.set('permalink_type_value', '');
|
||||
self.set('formSubmitted', false);
|
||||
self.sendAction('action', Discourse.Permalink.create(result.permalink));
|
||||
self.sendAction('action', Permalink.create(result.permalink));
|
||||
Em.run.schedule('afterRender', function() { self.$('.permalink-url').focus(); });
|
||||
}, function(e) {
|
||||
self.set('formSubmitted', false);
|
||||
|
Reference in New Issue
Block a user