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:
parent
d085c827ca
commit
d5a2bc0b63
6 changed files with 14 additions and 9 deletions
|
@ -2,6 +2,7 @@ import Ember from 'ember';
|
||||||
import TextInputMixin from 'ghost/mixins/text-input';
|
import TextInputMixin from 'ghost/mixins/text-input';
|
||||||
import boundOneWay from 'ghost/utils/bound-one-way';
|
import boundOneWay from 'ghost/utils/bound-one-way';
|
||||||
import {formatDate} from 'ghost/utils/date-formatting';
|
import {formatDate} from 'ghost/utils/date-formatting';
|
||||||
|
import {invokeAction} from 'ember-invoke-action';
|
||||||
|
|
||||||
const {Component} = Ember;
|
const {Component} = Ember;
|
||||||
|
|
||||||
|
@ -27,6 +28,6 @@ export default Component.extend(TextInputMixin, {
|
||||||
focusOut() {
|
focusOut() {
|
||||||
let datetime = this.get('datetime');
|
let datetime = this.get('datetime');
|
||||||
|
|
||||||
this.get('update')(datetime);
|
invokeAction(this, 'update', datetime);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,6 +2,7 @@ import Ember from 'ember';
|
||||||
import EditorAPI from 'ghost/mixins/ed-editor-api';
|
import EditorAPI from 'ghost/mixins/ed-editor-api';
|
||||||
import EditorShortcuts from 'ghost/mixins/ed-editor-shortcuts';
|
import EditorShortcuts from 'ghost/mixins/ed-editor-shortcuts';
|
||||||
import EditorScroll from 'ghost/mixins/ed-editor-scroll';
|
import EditorScroll from 'ghost/mixins/ed-editor-scroll';
|
||||||
|
import {invokeAction} from 'ember-invoke-action';
|
||||||
|
|
||||||
const {TextArea, run} = Ember;
|
const {TextArea, run} = Ember;
|
||||||
|
|
||||||
|
@ -32,7 +33,7 @@ export default TextArea.extend(EditorAPI, EditorShortcuts, EditorScroll, {
|
||||||
|
|
||||||
this.setFocus();
|
this.setFocus();
|
||||||
|
|
||||||
this.get('setEditor')(this);
|
invokeAction(this, 'setEditor', this);
|
||||||
|
|
||||||
run.scheduleOnce('afterRender', this, this.afterRenderEvent);
|
run.scheduleOnce('afterRender', this, this.afterRenderEvent);
|
||||||
},
|
},
|
||||||
|
@ -45,7 +46,7 @@ export default TextArea.extend(EditorAPI, EditorShortcuts, EditorScroll, {
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
toggleCopyHTMLModal(generatedHTML) {
|
toggleCopyHTMLModal(generatedHTML) {
|
||||||
this.get('toggleCopyHTMLModal')(generatedHTML);
|
invokeAction(this, 'toggleCopyHTMLModal', generatedHTML);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
import {invokeAction} from 'ember-invoke-action';
|
||||||
|
|
||||||
const {run, isBlank, Component} = Ember;
|
const {run, isBlank, Component} = Ember;
|
||||||
|
|
||||||
|
@ -21,7 +22,7 @@ export default Component.extend({
|
||||||
run.scheduleOnce('afterRender', this, isBlank(term) ? this.close : this.open);
|
run.scheduleOnce('afterRender', this, isBlank(term) ? this.close : this.open);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.get('select.actions.search')(term);
|
invokeAction(this, 'select.actions.search', term);
|
||||||
},
|
},
|
||||||
|
|
||||||
focusInput() {
|
focusInput() {
|
||||||
|
|
|
@ -109,15 +109,15 @@ export default Component.extend({
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
setProperty(property, value) {
|
setProperty(property, value) {
|
||||||
this.get('setProperty')(property, value);
|
invokeAction(this, 'setProperty', property, value);
|
||||||
},
|
},
|
||||||
|
|
||||||
setCoverImage(image) {
|
setCoverImage(image) {
|
||||||
this.get('setProperty')('image', image);
|
invokeAction(this, 'setProperty', 'image', image);
|
||||||
},
|
},
|
||||||
|
|
||||||
clearCoverImage() {
|
clearCoverImage() {
|
||||||
this.get('setProperty')('image', '');
|
invokeAction(this, 'setProperty', 'image', '');
|
||||||
},
|
},
|
||||||
|
|
||||||
openMeta() {
|
openMeta() {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
import {invokeAction} from 'ember-invoke-action';
|
||||||
|
|
||||||
const {Mixin, run} = Ember;
|
const {Mixin, run} = Ember;
|
||||||
|
|
||||||
|
@ -61,7 +62,7 @@ export default Mixin.create({
|
||||||
*/
|
*/
|
||||||
scrollHandler() {
|
scrollHandler() {
|
||||||
this.set('scrollThrottle', run.throttle(this, () => {
|
this.set('scrollThrottle', run.throttle(this, () => {
|
||||||
this.get('updateScrollInfo')(this.getScrollInfo());
|
invokeAction(this, 'updateScrollInfo', this.getScrollInfo());
|
||||||
}, 10));
|
}, 10));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
import {invokeAction} from 'ember-invoke-action';
|
||||||
|
|
||||||
const {LinkComponent, computed} = Ember;
|
const {LinkComponent, computed} = Ember;
|
||||||
|
|
||||||
|
@ -7,7 +8,7 @@ LinkComponent.reopen({
|
||||||
let isActive = this._super(...arguments);
|
let isActive = this._super(...arguments);
|
||||||
|
|
||||||
if (typeof this.get('alternateActive') === 'function') {
|
if (typeof this.get('alternateActive') === 'function') {
|
||||||
this.get('alternateActive')(isActive);
|
invokeAction(this, 'alternateActive', isActive);
|
||||||
}
|
}
|
||||||
|
|
||||||
return isActive;
|
return isActive;
|
||||||
|
|
Loading…
Add table
Reference in a new issue