Ember.K was deprecated, so let's remove it.

This commit is contained in:
Robin Ward 2017-06-13 15:59:48 -04:00
parent 74858fd450
commit 867cefc492
8 changed files with 13 additions and 10 deletions

View File

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

View File

@ -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');
});
},

View File

@ -2,5 +2,5 @@
export default {
name: "inject-objects",
initialize: Ember.K
initialize() { }
};

View File

@ -2,5 +2,5 @@
export default {
name: "register-discourse-location",
initialize: Ember.K
initialize() { }
};

View File

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

View File

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

View File

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

View File

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