mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-30 14:22:07 +03:00
909bd60db3
no issue - enter key when a modal is displayed will always trigger the `confirm` action, if it's not provided then the base modal will throw a `You must override the "confirm" action ...` error
25 lines
583 B
JavaScript
25 lines
583 B
JavaScript
import ModalComponent from 'ghost-admin/components/modal-base';
|
|
import {computed} from '@ember/object';
|
|
import {inject as service} from '@ember/service';
|
|
|
|
export default ModalComponent.extend({
|
|
router: service(),
|
|
|
|
upgradeMessage: computed('details', function () {
|
|
const {limit, total} = this.model.details;
|
|
const message = this.model.message;
|
|
|
|
return {limit, total, message};
|
|
}),
|
|
|
|
actions: {
|
|
upgrade() {
|
|
this.router.transitionTo('pro');
|
|
},
|
|
|
|
confirm() {
|
|
this.send('upgrade');
|
|
}
|
|
}
|
|
});
|