mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-23 10:53: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
49 lines
1.1 KiB
JavaScript
49 lines
1.1 KiB
JavaScript
import Route from '@ember/routing/route';
|
|
import {inject as service} from '@ember/service';
|
|
|
|
export default Route.extend({
|
|
billing: service(),
|
|
|
|
queryParams: {
|
|
action: {refreshModel: true}
|
|
},
|
|
|
|
beforeModel(transition) {
|
|
this.billing.set('previousTransition', transition);
|
|
},
|
|
|
|
model(params) {
|
|
if (params.action) {
|
|
this.billing.set('action', params.action);
|
|
}
|
|
|
|
this.billing.setBillingWindowOpen(true);
|
|
},
|
|
|
|
actions: {
|
|
willTransition(transition) {
|
|
let isBillingTransition = false;
|
|
|
|
if (transition) {
|
|
let destinationUrl = (typeof transition.to === 'string')
|
|
? transition.to
|
|
: (transition.intent
|
|
? transition.intent.url
|
|
: '');
|
|
|
|
if (destinationUrl?.includes('/billing')) {
|
|
isBillingTransition = true;
|
|
}
|
|
}
|
|
|
|
this.billing.setBillingWindowOpen(isBillingTransition);
|
|
}
|
|
},
|
|
|
|
buildRouteInfoMetadata() {
|
|
return {
|
|
titleToken: 'Billing'
|
|
};
|
|
}
|
|
});
|