diff --git a/app/assets/javascripts/discourse-common/lib/buffered-render.js.es6 b/app/assets/javascripts/discourse-common/lib/buffered-render.js.es6 index c77523f0339..f8d5bec53c2 100644 --- a/app/assets/javascripts/discourse-common/lib/buffered-render.js.es6 +++ b/app/assets/javascripts/discourse-common/lib/buffered-render.js.es6 @@ -27,18 +27,10 @@ export function bufferedRender(obj) { const caller = { }; - // True in 1.13 or greater - if (Ember.Helper) { - caller.didRender = function() { - this._super(); - this._customRender(); - }; - } else { - caller.didInsertElement = function() { - this._super(); - this._customRender(); - }; - } + caller.didRender = function() { + this._super(); + this._customRender(); + }; const triggers = obj.rerenderTriggers; if (triggers) { diff --git a/app/assets/javascripts/discourse-common/lib/helpers.js.es6 b/app/assets/javascripts/discourse-common/lib/helpers.js.es6 index dbff7e11862..33d64fc2e7c 100644 --- a/app/assets/javascripts/discourse-common/lib/helpers.js.es6 +++ b/app/assets/javascripts/discourse-common/lib/helpers.js.es6 @@ -1,27 +1,16 @@ import { get } from 'discourse-common/lib/raw-handlebars'; -// `Ember.Helper` is only available in versions after 1.12 export function htmlHelper(fn) { - if (Ember.Helper) { - return Ember.Helper.helper(function(...args) { - args = (args.length > 1) ? args[0].concat({ hash: args[args.length-1] }) : args; - return new Handlebars.SafeString(fn.apply(this, args) || ''); - }); - } else { - return Ember.Handlebars.makeBoundHelper(function() { - return new Handlebars.SafeString(fn.apply(this, Array.prototype.slice.call(arguments)) || ''); - }); - } + return Ember.Helper.helper(function(...args) { + args = (args.length > 1) ? args[0].concat({ hash: args[args.length-1] }) : args; + return new Handlebars.SafeString(fn.apply(this, args) || ''); + }); } const _helpers = {}; export function registerHelper(name, fn) { - if (Ember.Helper) { - _helpers[name] = Ember.Helper.helper(fn); - } else { - return Ember.HTMLBars._registerHelper(name, fn); - } + _helpers[name] = Ember.Helper.helper(fn); } export function findHelper(name) { @@ -65,14 +54,8 @@ export function registerUnbound(name, fn) { return fn.call(this, property, resolveParams(this, options)); }; - if (Ember.Helper) { - _helpers[name] = Ember.Helper.extend({ - compute: (params, args) => fn(params[0], args) - }); - Handlebars.registerHelper(name, func); - return; - } - + _helpers[name] = Ember.Helper.extend({ + compute: (params, args) => fn(params[0], args) + }); Handlebars.registerHelper(name, func); - Ember.Handlebars.registerHelper(name, func); } diff --git a/app/assets/javascripts/discourse/components/composer-message.js.es6 b/app/assets/javascripts/discourse/components/composer-message.js.es6 index 715afce98b3..7cbdc36b11f 100644 --- a/app/assets/javascripts/discourse/components/composer-message.js.es6 +++ b/app/assets/javascripts/discourse/components/composer-message.js.es6 @@ -5,7 +5,7 @@ export default Ember.Component.extend({ classNameBindings: [':composer-popup', ':hidden', 'message.extraClass'], @computed('message.templateName') - defaultLayout(templateName) { + layout(templateName) { return getOwner(this).lookup(`template:composer/${templateName}`); }, diff --git a/app/assets/javascripts/discourse/helpers/as-hash.js.es6 b/app/assets/javascripts/discourse/helpers/as-hash.js.es6 deleted file mode 100644 index df5abfcdfd1..00000000000 --- a/app/assets/javascripts/discourse/helpers/as-hash.js.es6 +++ /dev/null @@ -1,12 +0,0 @@ -import { registerHelper } from 'discourse-common/lib/helpers'; - -// Note: Later versions of ember include `hash` -registerHelper('as-hash', function(_, params) { - if (Ember.Helper) { return params; } - - const hash = {}; - Object.keys(params).forEach(k => { - hash[k] = params[k].value(); - }); - return hash; -}); diff --git a/app/assets/javascripts/discourse/mixins/delegated-actions.js.es6 b/app/assets/javascripts/discourse/mixins/delegated-actions.js.es6 index 8940c1d49bf..2aae916a9df 100644 --- a/app/assets/javascripts/discourse/mixins/delegated-actions.js.es6 +++ b/app/assets/javascripts/discourse/mixins/delegated-actions.js.es6 @@ -1,15 +1,11 @@ - -export const TARGET_NAME = (Ember.VERSION[0] === "2") ? 'actions' : '_actions'; - export default Ember.Mixin.create({ - delegateAll(actionNames) { actionNames = actionNames || []; - this[TARGET_NAME] = this[TARGET_NAME] || {}; + this.actions = this.actions || {}; actionNames.forEach(m => { - this[TARGET_NAME][m] = function() { this.sendAction(m); }; + this.actions[m] = function() { this.sendAction(m); }; this.set(m, m); }); } diff --git a/app/assets/javascripts/discourse/pre-initializers/map-routes.js.es6 b/app/assets/javascripts/discourse/pre-initializers/map-routes.js.es6 index 0a593c11bd9..e0736bca581 100644 --- a/app/assets/javascripts/discourse/pre-initializers/map-routes.js.es6 +++ b/app/assets/javascripts/discourse/pre-initializers/map-routes.js.es6 @@ -10,10 +10,7 @@ export default { // HACK to fix: https://github.com/emberjs/ember.js/issues/10310 const originalBuildInstance = originalBuildInstance || Ember.Application.prototype.buildInstance; Ember.Application.prototype.buildInstance = function() { - const registry = this.buildRegistry(); - if (Ember.VERSION[0] === "1") { - this.registry = registry; - } + this.buildRegistry(); return originalBuildInstance.apply(this); }; } diff --git a/app/assets/javascripts/discourse/templates/composer/similar-topics.hbs b/app/assets/javascripts/discourse/templates/composer/similar-topics.hbs index 0f9d3797e77..304352f5496 100644 --- a/app/assets/javascripts/discourse/templates/composer/similar-topics.hbs +++ b/app/assets/javascripts/discourse/templates/composer/similar-topics.hbs @@ -2,5 +2,5 @@