| @@ -2,12 +2,13 @@ | ||
| 2 | 2 | 'use strict'; |
| 3 | 3 | |
| 4 | 4 | const selectors = 'tr[data-slug="formidable"] .deactivate a, tr[data-slug="formidable-pro"] .deactivate a, tr[data-slug="formidable-forms-pro"] .deactivate a'; |
| 5 | 5 | |
| 6 | - let deactivationModal, deactivationUrl; | |
| 6 | + let deactivationModal; | |
| 7 | + let deactivationUrl; | |
| 7 | 8 | |
| 8 | 9 | const Modal = { |
| 9 | - init: function( id, width ) { | |
| 10 | + init( id, width ) { | |
| 10 | 11 | const $info = jQuery( id ); |
| 11 | 12 | const self = this; |
| 12 | 13 | |
| 13 | 14 | if ( ! $info.length ) { |
| @@ -13,9 +14,9 @@ | ||
| 13 | 14 | if ( ! $info.length ) { |
| 14 | 15 | return false; |
| 15 | 16 | } |
| 16 | 17 | |
| 17 | - if ( typeof width === 'undefined' ) { | |
| 18 | + if ( width === undefined ) { | |
| 18 | 19 | width = '550px'; |
| 19 | 20 | } |
| 20 | 21 | |
| 21 | 22 | const dialogArgs = { |
| @@ -22,12 +23,12 @@ | ||
| 22 | 23 | dialogClass: 'frm-dialog', |
| 23 | 24 | modal: true, |
| 24 | 25 | autoOpen: false, |
| 25 | 26 | closeOnEscape: true, |
| 26 | - width: width, | |
| 27 | + width, | |
| 27 | 28 | resizable: false, |
| 28 | 29 | draggable: false, |
| 29 | - open: function() { | |
| 30 | + open() { | |
| 30 | 31 | jQuery( '.ui-dialog-titlebar' ).addClass( 'frm_hidden' ).removeClass( 'ui-helper-clearfix' ); |
| 31 | 32 | jQuery( '#wpwrap' ).addClass( 'frm_overlay' ); |
| 32 | 33 | jQuery( '.frm-dialog' ).removeClass( 'ui-widget ui-widget-content ui-corner-all' ); |
| 33 | 34 | $info.removeClass( 'ui-dialog-content ui-widget-content' ); |
| @@ -32,9 +33,9 @@ | ||
| 32 | 33 | jQuery( '.frm-dialog' ).removeClass( 'ui-widget ui-widget-content ui-corner-all' ); |
| 33 | 34 | $info.removeClass( 'ui-dialog-content ui-widget-content' ); |
| 34 | 35 | self.bindClickForDialogClose( $info ); |
| 35 | 36 | }, |
| 36 | - close: function() { | |
| 37 | + close() { | |
| 37 | 38 | jQuery( '#wpwrap' ).removeClass( 'frm_overlay' ); |
| 38 | 39 | jQuery( '.spinner' ).css( 'visibility', 'hidden' ); |
| 39 | 40 | |
| 40 | 41 | this.removeAttribute( 'data-option-type' ); |
| @@ -49,9 +50,9 @@ | ||
| 49 | 50 | |
| 50 | 51 | return $info; |
| 51 | 52 | }, |
| 52 | 53 | |
| 53 | - bindClickForDialogClose: function( $modal ) { | |
| 54 | + bindClickForDialogClose( $modal ) { | |
| 54 | 55 | const closeModal = function() { |
| 55 | 56 | $modal.dialog( 'close' ); |
| 56 | 57 | }; |
| 57 | 58 | jQuery( '.ui-widget-overlay' ).on( 'click', closeModal ); |
| @@ -78,13 +79,13 @@ | ||
| 78 | 79 | '440px' |
| 79 | 80 | ); |
| 80 | 81 | } |
| 81 | 82 | |
| 82 | - deactivationUrl = event.target.href + '&frm_feedback_submitted=1'; | |
| 83 | + deactivationUrl = `${ event.target.href }&frm_feedback_submitted=1`; | |
| 83 | 84 | |
| 84 | 85 | const pluginSlug = event.target.closest( 'tr' ).dataset.slug; |
| 85 | 86 | |
| 86 | - const url = 'https://feedback.strategy11.com/wp-json/frm/v2/forms/deactivation-feedback?plugin_slug=' + pluginSlug + '&site=' + window.location.host + '&return=html&exclude_script=jquery&exclude_style=formidable-css'; | |
| 87 | + const url = `https://feedback.strategy11.com/wp-json/frm/v2/forms/deactivation-feedback?plugin_slug=${ pluginSlug }&site=${ window.location.host }&return=html&exclude_script=jquery&exclude_style=formidable-css`; | |
| 87 | 88 | |
| 88 | 89 | const response = fetch( url, { |
| 89 | 90 | method: 'GET' |
| 90 | 91 | } ); |