mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-02 08:13:34 +03:00
7d616b0010
no issue The billing iFrame needs to be rendered within the `main` content area rather than as fullscreen. This needs most probably more tidying up, but is working for now without breaking the functionality. * Move billing iFrame to render in main content area * Fixed routing error when transistion url not defined * Removed close modal button and esc key binding
43 lines
1.0 KiB
JavaScript
43 lines
1.0 KiB
JavaScript
/* global key */
|
|
import Component from '@ember/component';
|
|
import {computed} from '@ember/object';
|
|
import {run} from '@ember/runloop';
|
|
import {inject as service} from '@ember/service';
|
|
|
|
export default Component.extend({
|
|
billing: service(),
|
|
|
|
visibilityClass: computed('billing.billingWindowOpen', function () {
|
|
return this.billing.get('billingWindowOpen') ? 'gh-billing' : 'gh-billing closed';
|
|
}),
|
|
|
|
didInsertElement() {
|
|
this._super(...arguments);
|
|
this._setupShortcuts();
|
|
},
|
|
|
|
willDestroyElement() {
|
|
this._super(...arguments);
|
|
this._removeShortcuts();
|
|
},
|
|
|
|
_setupShortcuts() {
|
|
run(function () {
|
|
document.activeElement.blur();
|
|
});
|
|
|
|
this._previousKeymasterScope = key.getScope();
|
|
|
|
key('enter', 'modal', () => {
|
|
this.send('confirm');
|
|
});
|
|
|
|
key.setScope('modal');
|
|
},
|
|
|
|
_removeShortcuts() {
|
|
key.unbind('enter', 'modal');
|
|
key.setScope(this._previousKeymasterScope);
|
|
}
|
|
});
|