# search-replace-wpcode/1.0.6/src/admin/modal.js

Search &amp; Replace Everything by WPCode – Find and Replace Media, Text, Links, and More, version 1.0.6. 26 lines.

- Page: https://pluginprobe.com/plugins/search-replace-wpcode/1.0.6/code/src/admin/modal.js
- Raw: https://pluginprobe.com/plugins/search-replace-wpcode/1.0.6/raw/src/admin/modal.js
- Modified: 2024-11-14T05:21:14+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/search-replace-wpcode/1.0.6/code/src/admin/modal.js#L10-L20`.

```javascript
jQuery( function ( $ ) {
	$( '.wsrw-close-modal, .wsrw-modal-overlay' ).on(
		'click',
		function () {
			const $body = $( 'body' );
			// Let's disable closing the modal if a specific class is used.
			if ( $body.hasClass( 'wsrw-no-close' ) ) {
				return;
			}
			$body.removeClass( 'wsrw-show-modal' );

			$(document).trigger( 'wsrw-modal-closed' );
		}
	);
	$( '.wsrw-search-replace-history .wsrw-close-modal,.wsrw-search-replace-history .wsrw-modal-overlay' ).on(
		'click',
		function () {

			$( '.wsrw-modal' ).hide();
			$( '.wsrw-modal-overlay' ).hide();
			$( '.wsrw-undo-operation' ).prop( 'disabled', false );
			$( '#wsrw-results-table' ).find('tr:not(:first-child)').remove();
		}
	);
} );

```
