Skip to content

Commit

Permalink
more specific events
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoladj77 committed Jan 5, 2025
1 parent 1fb0caa commit 619524b
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions modules/template-parts/assets/js/editor/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,22 @@ export default class TemplatesModule extends elementorModules.editor.utils.Modul
elementor.hooks.addFilter( 'elements/widget/controls/common/default', this.resetCommonControls.bind( this ) );
elementor.hooks.addFilter( 'elements/widget/controls/common-optimized/default', this.resetCommonControls.bind( this ) );

window.addEventListener( 'core/modal/close', () => {
if ( this.isEhpDocument() ) {
window.location.href = elementor.config.close_modal_redirect_hello_plus;
}
const types = [
'core/modal/close/ehp-footer',
'core/modal/close/ehp-header',
];

types.forEach( ( type ) => {
window.addEventListener( type, this.redirectToHelloPlus );
} );

window.templatesModule = this;
}

redirectToHelloPlus() {
window.location.href = elementor.config.close_modal_redirect_hello_plus;
}

async openSiteIdentity() {
await $e.run( 'panel/global/open' );
$e.route( 'panel/global/settings-site-identity' );
Expand Down

0 comments on commit 619524b

Please sign in to comment.