PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-a.7
Jetpack – WP Security, Backup, Speed, & Growth v16.3-a.7
16.3-a.5 16.3-a.7 16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 All 506 releases
← All changes | _inc/jetpack-deactivate-dialog.js +11 -9 13.7.2 → 16.3-a.7 View file →
@@ -1,4 +1,5 @@
1 +/* globals analytics, deactivate_dialog, tb_remove */
1 2 /**
2 3 * Adds the Deactivation modal.
3 4 *
4 5 * Depends on _inc/lib/tracks/tracks-callables.js and //stats.wp.com/w.js
@@ -27,15 +28,16 @@
27 28 if ( 'TB_window' === addedNode.id ) {
28 29 // NodeList is static, we need to modify this in the DOM
29 30
30 31 $( '#TB_window' ).addClass( 'jetpack-disconnect-modal' );
31 - deactivationModalCentralize();
32 + window.deactivationModalCentralize();
32 33
33 - $( '#TB_closeWindowButton, #TB_overlay' ).on( 'click', function ( e ) {
34 - deactivationModalTrackCloseEvent();
34 + $( '#TB_closeWindowButton, #TB_overlay' ).on( 'click', function () {
35 + window.deactivationModalTrackCloseEvent();
35 36 } );
36 37
37 38 document.onkeyup = function ( e ) {
39 + var keycode;
38 40 if ( e === null ) {
39 41 // ie
40 42 keycode = event.keyCode;
41 43 } else {
@@ -41,11 +43,11 @@
41 43 } else {
42 44 // mozilla
43 45 keycode = e.which;
44 46 }
45 - if ( keycode == 27 ) {
47 + if ( keycode === 27 ) {
46 48 // close
47 - deactivationModalTrackCloseEvent();
49 + window.deactivationModalTrackCloseEvent();
48 50 }
49 51 };
50 52
51 53 observer.disconnect();
@@ -76,16 +78,16 @@
76 78 deactivateLinkElem.attr( 'href', 'plugins.php#TB_inline?inlineId=jetpack_deactivation_dialog' );
77 79 deactivateLinkElem.attr( 'title', deactivate_dialog.title );
78 80 deactivateLinkElem.addClass( 'thickbox' );
79 81 deactivateLinkElem.html( deactivate_dialog.deactivate_label );
80 - deactivateLinkElem.on( 'click', function ( e ) {
82 + deactivateLinkElem.on( 'click', function () {
81 83 observer.observe( body, { childList: true } );
82 84 analytics.tracks.recordEvent( 'jetpack_termination_dialog_open', tracksProps );
83 85 } );
84 86
85 - $( '#jetpack_deactivation_dialog_content__button-cancel' ).on( 'click', function ( e ) {
87 + $( '#jetpack_deactivation_dialog_content__button-cancel' ).on( 'click', function () {
86 88 tb_remove();
87 - deactivationModalTrackCloseEvent();
89 + window.deactivationModalTrackCloseEvent();
88 90 } );
89 91
90 92 $( '#jetpack_deactivation_dialog_content__button-deactivate' ).on( 'click', function ( e ) {
91 93 e.preventDefault();
@@ -91,7 +93,7 @@
91 93 e.preventDefault();
92 94
93 95 $( this ).prop( 'disabled', true );
94 96 analytics.tracks.recordEvent( 'jetpack_termination_dialog_termination_click', tracksProps );
95 - deactivateJetpack();
97 + window.deactivateJetpack();
96 98 } );
97 99 } )( jQuery );