| 1 |
jQuery( function ( $ ) { |
| 2 |
$( '.wsrw-close-modal, .wsrw-modal-overlay' ).on( |
| 3 |
'click', |
| 4 |
function () { |
| 5 |
const $body = $( 'body' ); |
| 6 |
// Let's disable closing the modal if a specific class is used. |
| 7 |
if ( $body.hasClass( 'wsrw-no-close' ) ) { |
| 8 |
return; |
| 9 |
} |
| 10 |
$body.removeClass( 'wsrw-show-modal' ); |
| 11 |
|
| 12 |
$(document).trigger( 'wsrw-modal-closed' ); |
| 13 |
} |
| 14 |
); |
| 15 |
$( '.wsrw-search-replace-history .wsrw-close-modal,.wsrw-search-replace-history .wsrw-modal-overlay' ).on( |
| 16 |
'click', |
| 17 |
function () { |
| 18 |
|
| 19 |
$( '.wsrw-modal' ).hide(); |
| 20 |
$( '.wsrw-modal-overlay' ).hide(); |
| 21 |
$( '.wsrw-undo-operation' ).prop( 'disabled', false ); |
| 22 |
$( '#wsrw-results-table' ).find('tr:not(:first-child)').remove(); |
| 23 |
} |
| 24 |
); |
| 25 |
} ); |
| 26 |
|