PluginProbe
Search & Replace Everything by WPCode – Find and Replace Media, Text, Links, and More / 1.0.6
Search & Replace Everything by WPCode – Find and Replace Media, Text, Links, and More v1.0.6
trunk 1.0.0 1.0.1 1.0.10 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9
search-replace-wpcode / src / admin / spinner.js

spinner.js in Search & Replace Everything by WPCode – Find and Replace Media, Text, Links, and More 1.0.6, at src/admin/spinner.js

39 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 const WSRSpinner = window.WSRSpinner || (
2 function ( document, window, $ ) {
3 const app = {
4 init() {
5 window.WSRSpinner = app;
6 app.spinner = $( '#wsrw-admin-spinner' );
7 },
8 show_button_spinner( $button, position = 'right' ) {
9 $button.prop( 'disabled', true );
10 const offset = $button.offset();
11 const menu_width = $( '#adminmenuwrap' ).width();
12 const admin_bar = $( '#wpadminbar' ).height();
13 let css = {};
14 app.spinner.show();
15 if ( 'right' === position ) {
16 css = {
17 left: offset.left - menu_width + $button.outerWidth(),
18 top: offset.top - admin_bar + $button.outerHeight() / 2 - app.spinner.height() / 2,
19 };
20 } else {
21 css = {
22 left: offset.left - menu_width - app.spinner.outerWidth() - 20,
23 top: offset.top - admin_bar + $button.outerHeight() / 2 - app.spinner.height() / 2,
24 };
25 }
26
27 app.spinner.css( css );
28 },
29 hide_button_spinner( $button ) {
30 $button.prop( 'disabled', false );
31 app.spinner.hide();
32 },
33 };
34 return app;
35 }( document, window, jQuery )
36 );
37
38 WSRSpinner.init();
39