From 867cefc49286c27921bb4fb2ca2ad44400527921 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Tue, 13 Jun 2017 15:59:48 -0400 Subject: [PATCH] Ember.K was deprecated, so let's remove it. --- .../javascripts/discourse/components/d-editor.js.es6 | 2 +- .../discourse/controllers/topic-bulk-actions.js.es6 | 9 ++++++--- .../discourse/initializers/inject-objects.js.es6 | 2 +- .../initializers/register-discourse-location.js.es6 | 2 +- .../discourse/lib/posts-with-placeholders.js.es6 | 2 +- app/assets/javascripts/discourse/models/rest.js.es6 | 2 +- test/javascripts/helpers/qunit-helpers.js.es6 | 2 +- test/javascripts/test_helper.js | 2 +- 8 files changed, 13 insertions(+), 10 deletions(-) diff --git a/app/assets/javascripts/discourse/components/d-editor.js.es6 b/app/assets/javascripts/discourse/components/d-editor.js.es6 index ffeac152a6..34a32a5d57 100644 --- a/app/assets/javascripts/discourse/components/d-editor.js.es6 +++ b/app/assets/javascripts/discourse/components/d-editor.js.es6 @@ -138,7 +138,7 @@ class Toolbar { label: button.label, icon: button.label ? null : button.icon || button.id, action: button.action || 'toolbarButton', - perform: button.perform || Ember.K, + perform: button.perform || function() { }, trimLeading: button.trimLeading }; diff --git a/app/assets/javascripts/discourse/controllers/topic-bulk-actions.js.es6 b/app/assets/javascripts/discourse/controllers/topic-bulk-actions.js.es6 index ac84cf1968..ef7d23eba7 100644 --- a/app/assets/javascripts/discourse/controllers/topic-bulk-actions.js.es6 +++ b/app/assets/javascripts/discourse/controllers/topic-bulk-actions.js.es6 @@ -4,6 +4,9 @@ const _buttons = []; const alwaysTrue = () => true; +function identity() { +} + function addBulkButton(action, key, opts) { opts = opts || {}; @@ -72,7 +75,7 @@ export default Ember.Controller.extend(ModalFunctionality, { this.perform(operation).then(topics => { if (topics) { topics.forEach(cb); - (this.get('refreshClosure') || Ember.k)(); + (this.get('refreshClosure') || identity)(); this.send('closeModal'); } }); @@ -80,7 +83,7 @@ export default Ember.Controller.extend(ModalFunctionality, { performAndRefresh(operation) { return this.perform(operation).then(() => { - (this.get('refreshClosure') || Ember.k)(); + (this.get('refreshClosure') || identity)(); this.send('closeModal'); }); }, @@ -145,7 +148,7 @@ export default Ember.Controller.extend(ModalFunctionality, { this.perform({type: 'change_category', category_id: categoryId}).then(topics => { topics.forEach(t => t.set('category', category)); - (this.get('refreshClosure') || Ember.k)(); + (this.get('refreshClosure') || identity)(); this.send('closeModal'); }); }, diff --git a/app/assets/javascripts/discourse/initializers/inject-objects.js.es6 b/app/assets/javascripts/discourse/initializers/inject-objects.js.es6 index f15f57fa8a..1ad38a8fb1 100644 --- a/app/assets/javascripts/discourse/initializers/inject-objects.js.es6 +++ b/app/assets/javascripts/discourse/initializers/inject-objects.js.es6 @@ -2,5 +2,5 @@ export default { name: "inject-objects", - initialize: Ember.K + initialize() { } }; diff --git a/app/assets/javascripts/discourse/initializers/register-discourse-location.js.es6 b/app/assets/javascripts/discourse/initializers/register-discourse-location.js.es6 index 1f073e95cf..88c49402a8 100644 --- a/app/assets/javascripts/discourse/initializers/register-discourse-location.js.es6 +++ b/app/assets/javascripts/discourse/initializers/register-discourse-location.js.es6 @@ -2,5 +2,5 @@ export default { name: "register-discourse-location", - initialize: Ember.K + initialize() { } }; diff --git a/app/assets/javascripts/discourse/lib/posts-with-placeholders.js.es6 b/app/assets/javascripts/discourse/lib/posts-with-placeholders.js.es6 index a57f46c9eb..fcad355343 100644 --- a/app/assets/javascripts/discourse/lib/posts-with-placeholders.js.es6 +++ b/app/assets/javascripts/discourse/lib/posts-with-placeholders.js.es6 @@ -56,7 +56,7 @@ export default Ember.Object.extend(Ember.Array, { }, finishedPrepending(postIds) { - this._changeArray(Ember.K, 0, 0, postIds.length); + this._changeArray(function() { }, 0, 0, postIds.length); }, objectAt(index) { diff --git a/app/assets/javascripts/discourse/models/rest.js.es6 b/app/assets/javascripts/discourse/models/rest.js.es6 index 0c595bb735..ed78efd752 100644 --- a/app/assets/javascripts/discourse/models/rest.js.es6 +++ b/app/assets/javascripts/discourse/models/rest.js.es6 @@ -3,7 +3,7 @@ const RestModel = Ember.Object.extend({ isCreated: Ember.computed.equal('__state', 'created'), isSaving: false, - afterUpdate: Ember.K, + afterUpdate() { }, update(props) { if (this.get('isSaving')) { return Ember.RSVP.reject(); } diff --git a/test/javascripts/helpers/qunit-helpers.js.es6 b/test/javascripts/helpers/qunit-helpers.js.es6 index 32747f9c5a..bb296f0d77 100644 --- a/test/javascripts/helpers/qunit-helpers.js.es6 +++ b/test/javascripts/helpers/qunit-helpers.js.es6 @@ -45,7 +45,7 @@ function acceptance(name, options) { resetMobile(); // For now don't do scrolling stuff in Test Mode - HeaderComponent.reopen({examineDockHeader: Ember.K}); + HeaderComponent.reopen({examineDockHeader: function() { }}); resetExtraClasses(); const siteJson = siteFixtures['site.json'].site; diff --git a/test/javascripts/test_helper.js b/test/javascripts/test_helper.js index 12b73912ba..e1ac22f381 100644 --- a/test/javascripts/test_helper.js +++ b/test/javascripts/test_helper.js @@ -108,7 +108,7 @@ QUnit.testStart(function(ctx) { window.sandbox.stub(ScrollingDOMMethods, "unbindOnScroll"); // Unless we ever need to test this, let's leave it off. - $.fn.autocomplete = Ember.K; + $.fn.autocomplete = function() { }; // Don't debounce in test unless we're testing debouncing if (ctx.module.indexOf('debounce') === -1) {