Add an ENV variable to enable the stricter, plugin-incompatible ES6
behaviour for development.
This commit is contained in:
parent
b5239be2fa
commit
ad90d9710d
|
@ -6,7 +6,7 @@
|
|||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.PosterExpansionController = Discourse.ObjectController.extend({
|
||||
export default Discourse.ObjectController.extend({
|
||||
needs: ['topic'],
|
||||
visible: false,
|
||||
user: null,
|
|
@ -6,7 +6,7 @@
|
|||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.PreferencesAboutController = Discourse.ObjectController.extend({
|
||||
export default Discourse.ObjectController.extend({
|
||||
saving: false,
|
||||
|
||||
saveButtonText: function() {
|
||||
|
@ -14,4 +14,4 @@ Discourse.PreferencesAboutController = Discourse.ObjectController.extend({
|
|||
return I18n.t("user.change");
|
||||
}.property('saving')
|
||||
|
||||
});
|
||||
});
|
|
@ -86,10 +86,10 @@ Discourse.PreferencesAboutRoute = Discourse.RestrictedUserRoute.extend({
|
|||
this.render('preferences', { into: 'user', outlet: 'userOutlet', controller: 'preferences' });
|
||||
},
|
||||
|
||||
events: {
|
||||
actions: {
|
||||
changeAbout: function() {
|
||||
var route = this;
|
||||
var controller = route.controllerFor('preferencesAbout');
|
||||
var controller = route.controllerFor('preferences/about');
|
||||
|
||||
controller.setProperties({ saving: true });
|
||||
return controller.get('model').save().then(function() {
|
||||
|
|
|
@ -17,7 +17,7 @@ Discourse.TopicRoute = Discourse.Route.extend({
|
|||
actions: {
|
||||
// Modals that can pop up within a topic
|
||||
showPosterExpansion: function(post) {
|
||||
this.controllerFor('posterExpansion').show(post);
|
||||
this.controllerFor('poster-expansion').show(post);
|
||||
},
|
||||
|
||||
composePrivateMessage: function(user) {
|
||||
|
@ -137,7 +137,7 @@ Discourse.TopicRoute = Discourse.Route.extend({
|
|||
|
||||
// Clear the search context
|
||||
this.controllerFor('search').set('searchContext', null);
|
||||
this.controllerFor('posterExpansion').set('visible', false);
|
||||
this.controllerFor('poster-expansion').set('visible', false);
|
||||
|
||||
var topicController = this.controllerFor('topic'),
|
||||
postStream = topicController.get('postStream');
|
||||
|
|
|
@ -68,7 +68,7 @@ module Tilt
|
|||
# For backwards compatibility with plugins, for now export the Global format too.
|
||||
# We should eventually have an upgrade system for plugins to use ES6 or some other
|
||||
# resolve based API.
|
||||
if scope.logical_path =~ /discourse\/controllers\/(.*)/
|
||||
if ENV['DISCOURSE_NO_CONSTANTS'].nil? && scope.logical_path =~ /discourse\/controllers\/(.*)/
|
||||
class_name = Regexp.last_match[1].gsub(/[\-\/]/, '_').classify
|
||||
@output << "\n\nDiscourse.#{class_name}Controller = require('#{scope.logical_path}').default"
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue