require( [ 'jquery', 'Magento_Ui/js/modal/modal' ], function( $, modal ) { var options = { type: 'popup', responsive: true, innerScroll: true, title: 'Title', buttons: [{ text: $.mage.__('Proceed'), class: '', click: function () { /* some stuff */ this.closeModal(); } }] }; var popup = modal(options,$('#popup-modal')); $('#popup-modal').modal('openModal'); } );
Popup works fine but I want to execute some code when the popup closes.
Thanks for the answers,
Popup can be closed by clicking x
button or escape key
.
But I don't think adding multiple events for click and keypress is a good idea.