PluginProbe
WPVR – 360 Panorama viewer and Virtual Tour Builder for WordPress / 8.5.76
WPVR – 360 Panorama viewer and Virtual Tour Builder for WordPress v8.5.76
9.1.2 9.1.1 9.1.0 9.0.3 9.0.2 9.0.1 9.0.0 8.5.79 8.5.78 8.5.77 8.5.76 8.5.75 8.5.74 8.5.73 8.5.72 8.5.71 8.5.70 8.5.69 8.5.68 8.5.35 8.5.36 8.5.37 8.5.38 8.5.39 8.5.4 All 221 releases
wpvr / admin / js / wpvr-deactivation.js

wpvr-deactivation.js in WPVR – 360 Panorama viewer and Virtual Tour Builder for WordPress 8.5.76, at admin/js/wpvr-deactivation.js

45 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (function ($) {
2 'use strict';
3
4 function init(modal) {
5 // Auto-select first reason card.
6 var $firstLi = modal.find('ul.wd-de-reasons li').first();
7 var $firstRadio = $firstLi.find('input[type="radio"]');
8 $firstRadio.prop('checked', true);
9 $firstLi.addClass('wd-de-reason-selected');
10 modal.find('.wd-dr-modal-reason-input').show();
11 modal.find('.wd-dr-modal-reason-input textarea').attr('placeholder', $firstLi.data('placeholder'));
12
13 // Narrow modal.
14 modal.find('.wd-dr-modal-wrap').css({ 'max-width': '700px', 'border-radius': '8px' });
15
16 // Focus textarea when modal opens.
17 if ( modal[0] && window.MutationObserver ) {
18 var observer = new MutationObserver(function (mutations) {
19 mutations.forEach(function (mutation) {
20 if ( mutation.attributeName === 'class' && modal.hasClass('modal-active') ) {
21 modal.find('.wd-dr-modal-reason-input textarea').focus();
22 }
23 });
24 });
25 observer.observe(modal[0], { attributes: true });
26 }
27
28 // De-emphasise "Skip & Deactivate".
29 modal.find('a.dont-bother-me').css({
30 'font-size': '11px',
31 'color': '#a0aec0',
32 'border': 'none',
33 'padding': '5px 6px'
34 });
35 }
36
37 $(function () {
38 var modal = $('#wpvr-wd-dr-modal');
39 if (modal.length) {
40 init(modal);
41 }
42 });
43
44 }(jQuery));
45