0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-27 22:49:56 -05:00

convert more action calls to the ember-invoke-action syntax

This commit is contained in:
Austin Burdine 2016-04-28 10:34:36 -05:00
parent d085c827ca
commit d5a2bc0b63
6 changed files with 14 additions and 9 deletions

View file

@ -2,6 +2,7 @@ import Ember from 'ember';
import TextInputMixin from 'ghost/mixins/text-input';
import boundOneWay from 'ghost/utils/bound-one-way';
import {formatDate} from 'ghost/utils/date-formatting';
import {invokeAction} from 'ember-invoke-action';
const {Component} = Ember;
@ -27,6 +28,6 @@ export default Component.extend(TextInputMixin, {
focusOut() {
let datetime = this.get('datetime');
this.get('update')(datetime);
invokeAction(this, 'update', datetime);
}
});

View file

@ -2,6 +2,7 @@ import Ember from 'ember';
import EditorAPI from 'ghost/mixins/ed-editor-api';
import EditorShortcuts from 'ghost/mixins/ed-editor-shortcuts';
import EditorScroll from 'ghost/mixins/ed-editor-scroll';
import {invokeAction} from 'ember-invoke-action';
const {TextArea, run} = Ember;
@ -32,7 +33,7 @@ export default TextArea.extend(EditorAPI, EditorShortcuts, EditorScroll, {
this.setFocus();
this.get('setEditor')(this);
invokeAction(this, 'setEditor', this);
run.scheduleOnce('afterRender', this, this.afterRenderEvent);
},
@ -45,7 +46,7 @@ export default TextArea.extend(EditorAPI, EditorShortcuts, EditorScroll, {
actions: {
toggleCopyHTMLModal(generatedHTML) {
this.get('toggleCopyHTMLModal')(generatedHTML);
invokeAction(this, 'toggleCopyHTMLModal', generatedHTML);
}
}
});

View file

@ -1,4 +1,5 @@
import Ember from 'ember';
import {invokeAction} from 'ember-invoke-action';
const {run, isBlank, Component} = Ember;
@ -21,7 +22,7 @@ export default Component.extend({
run.scheduleOnce('afterRender', this, isBlank(term) ? this.close : this.open);
}
this.get('select.actions.search')(term);
invokeAction(this, 'select.actions.search', term);
},
focusInput() {

View file

@ -109,15 +109,15 @@ export default Component.extend({
actions: {
setProperty(property, value) {
this.get('setProperty')(property, value);
invokeAction(this, 'setProperty', property, value);
},
setCoverImage(image) {
this.get('setProperty')('image', image);
invokeAction(this, 'setProperty', 'image', image);
},
clearCoverImage() {
this.get('setProperty')('image', '');
invokeAction(this, 'setProperty', 'image', '');
},
openMeta() {

View file

@ -1,4 +1,5 @@
import Ember from 'ember';
import {invokeAction} from 'ember-invoke-action';
const {Mixin, run} = Ember;
@ -61,7 +62,7 @@ export default Mixin.create({
*/
scrollHandler() {
this.set('scrollThrottle', run.throttle(this, () => {
this.get('updateScrollInfo')(this.getScrollInfo());
invokeAction(this, 'updateScrollInfo', this.getScrollInfo());
}, 10));
},

View file

@ -1,4 +1,5 @@
import Ember from 'ember';
import {invokeAction} from 'ember-invoke-action';
const {LinkComponent, computed} = Ember;
@ -7,7 +8,7 @@ LinkComponent.reopen({
let isActive = this._super(...arguments);
if (typeof this.get('alternateActive') === 'function') {
this.get('alternateActive')(isActive);
invokeAction(this, 'alternateActive', isActive);
}
return isActive;