mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-17 23:44:39 -05:00
27 lines
745 B
JavaScript
27 lines
745 B
JavaScript
|
import Ember from 'ember';
|
||
|
import ModalComponent from 'ghost/components/modals/base';
|
||
|
|
||
|
export default ModalComponent.extend({
|
||
|
actions: {
|
||
|
updateEmail(newEmail) {
|
||
|
this.set('model.email', newEmail);
|
||
|
this.set('model.hasValidated', Ember.A());
|
||
|
this.get('model.errors').clear();
|
||
|
},
|
||
|
|
||
|
confirm() {
|
||
|
let confirmAction = this.get('confirm');
|
||
|
|
||
|
this.set('submitting', true);
|
||
|
|
||
|
confirmAction().then(() => {
|
||
|
this.send('closeModal');
|
||
|
}).finally(() => {
|
||
|
if (!this.get('isDestroying') && !this.get('isDestroyed')) {
|
||
|
this.set('submitting', false);
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
});
|