1
0
Fork 0
mirror of https://github.com/TryGhost/Ghost-Admin.git synced 2023-12-14 02:33:04 +01:00

deps: ember-invoke-action@1.3.0

no issue
- replace instances of `this.get('action')()` with ember-invoke-action syntax
This commit is contained in:
Austin Burdine 2016-04-26 16:32:17 -05:00
parent d4ca5ced75
commit d957f52508
12 changed files with 27 additions and 14 deletions

View file

@ -2,6 +2,7 @@ import Ember from 'ember';
import ShortcutsMixin from 'ghost/mixins/shortcuts';
import imageManager from 'ghost/utils/ed-image-manager';
import editorShortcuts from 'ghost/utils/editor-shortcuts';
import {invokeAction} from 'ember-invoke-action';
const {Component, computed, run} = Ember;
const {equal} = computed;
@ -52,9 +53,8 @@ export default Component.extend(ShortcutsMixin, {
},
willDestroyElement() {
if (this.get('onTeardown')) {
this.get('onTeardown')();
}
invokeAction(this, 'onTeardown');
this.removeShortcuts();
},

View file

@ -1,5 +1,6 @@
import Ember from 'ember';
import LiquidTether from 'liquid-tether/components/liquid-tether';
import {invokeAction} from 'ember-invoke-action';
const {
RSVP: {Promise},
@ -50,8 +51,10 @@ const FullScreenModalComponent = LiquidTether.extend({
actions: {
close() {
// Because we return the promise from invokeAction, we have
// to check if "close" exists first
if (this.get('close')) {
return this.get('close')();
return invokeAction(this, 'close');
}
return new Promise((resolve) => {
@ -61,7 +64,7 @@ const FullScreenModalComponent = LiquidTether.extend({
confirm() {
if (this.get('confirm')) {
return this.get('confirm')();
return invokeAction(this, 'confirm');
}
return new Promise((resolve) => {

View file

@ -1,4 +1,5 @@
import Ember from 'ember';
import {invokeAction} from 'ember-invoke-action';
const {TextField, computed, run} = Ember;
@ -67,7 +68,7 @@ export default TextField.extend({
},
keyPress(event) {
this.get('clearErrors')();
invokeAction(this, 'clearErrors');
// enter key
if (event.keyCode === 13) {

View file

@ -1,5 +1,6 @@
import Ember from 'ember';
import ActiveLinkWrapper from 'ghost/mixins/active-link-wrapper';
import {invokeAction} from 'ember-invoke-action';
const {
$,
@ -51,7 +52,7 @@ export default Component.extend(ActiveLinkWrapper, {
this._super(...arguments);
this.removeObserver('active', this, this.scrollIntoView);
if (this.get('post.isDeleted') && this.get('onDelete')) {
this.get('onDelete')();
invokeAction(this, 'onDelete');
}
},

View file

@ -1,6 +1,7 @@
/* global key */
import Ember from 'ember';
import boundOneWay from 'ghost/utils/bound-one-way';
import {invokeAction} from 'ember-invoke-action';
const {
Component,
@ -128,7 +129,7 @@ export default Component.extend({
},
deleteTag() {
this.get('showDeleteTagModal')();
invokeAction(this, 'showDeleteTagModal');
}
}

View file

@ -1,11 +1,12 @@
import Ember from 'ember';
import {invokeAction} from 'ember-invoke-action';
export default Ember.Component.extend({
willDestroyElement() {
this._super(...arguments);
if (this.get('tag.isDeleted') && this.get('onDelete')) {
this.get('onDelete')();
invokeAction(this, 'onDelete');
}
}
});

View file

@ -1,5 +1,6 @@
/* global key */
import Ember from 'ember';
import {invokeAction} from 'ember-invoke-action';
const {Component, run} = Ember;
@ -49,7 +50,7 @@ export default Component.extend({
},
closeModal() {
this.get('closeModal')();
invokeAction(this, 'closeModal');
}
}
});

View file

@ -1,5 +1,6 @@
import Ember from 'ember';
import ModalComponent from 'ghost/components/modals/base';
import {invokeAction} from 'ember-invoke-action';
const {computed} = Ember;
const {alias} = computed;
@ -18,7 +19,7 @@ export default ModalComponent.extend({
confirm() {
this.set('submitting', true);
this.get('confirm')().finally(() => {
invokeAction(this, 'confirm').finally(() => {
this.send('closeModal');
});
}

View file

@ -1,4 +1,5 @@
import ModalComponent from 'ghost/components/modals/base';
import {invokeAction} from 'ember-invoke-action';
export default ModalComponent.extend({
@ -10,7 +11,7 @@ export default ModalComponent.extend({
confirm() {
this.set('submitting', true);
this.get('confirm')().finally(() => {
invokeAction(this, 'confirm').finally(() => {
this.send('closeModal');
});
}

View file

@ -1,9 +1,10 @@
import ModalComponent from 'ghost/components/modals/base';
import {invokeAction} from 'ember-invoke-action';
export default ModalComponent.extend({
actions: {
confirm() {
this.get('confirm')().finally(() => {
invokeAction(this, 'confirm').finally(() => {
this.send('closeModal');
});
}

View file

@ -1,4 +1,5 @@
import ModalComponent from 'ghost/components/modals/base';
import {invokeAction} from 'ember-invoke-action';
export default ModalComponent.extend({
user: null,
@ -8,7 +9,7 @@ export default ModalComponent.extend({
confirm() {
this.set('submitting', true);
this.get('confirm')().finally(() => {
invokeAction(this, 'confirm').finally(() => {
this.send('closeModal');
});
}

View file

@ -41,6 +41,7 @@
"ember-data": "2.5.2",
"ember-data-filter": "1.13.0",
"ember-export-application-global": "1.0.5",
"ember-invoke-action": "1.3.0",
"ember-load-initializers": "0.5.1",
"ember-myth": "0.1.1",
"ember-one-way-controls": "0.6.2",