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:
Sam
2015-11-21 00:14:50 +11:00
parent f5b34d5f53
commit c0b277d273
98 changed files with 380 additions and 379 deletions

View File

@ -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);