Skip to content

Commit 512ff50

Browse files
committed
Use var instead of let and const, to make sure features always work in older browsers as well.
1 parent a10e10f commit 512ff50

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

js/deprecation-notice.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
* Show all jQuery Migrate warnings in the UI.
33
*/
44
jQuery( document ).ready( function( $ ) {
5-
const notice = $( '.notice.jquery-migrate-deprecation-notice' );
6-
const warnings = jQuery.migrateWarnings || [];
7-
const adminbar = $( '#wp-admin-bar-enable-jquery-migrate-helper' );
8-
const countWrapper = $( '.count-wrapper', adminbar );
5+
var notice = $( '.notice.jquery-migrate-deprecation-notice' );
6+
var warnings = jQuery.migrateWarnings || [];
7+
var adminbar = $( '#wp-admin-bar-enable-jquery-migrate-helper' );
8+
var countWrapper = $( '.count-wrapper', adminbar );
99

1010
var previousDeprecations = [];
1111

1212
/**
1313
* Filter the trace, return the first URI that is to a plugin or theme script.
1414
*/
1515
function getSlugFromTrace( trace ) {
16-
let traceLines = trace.split( '\n' ),
16+
var traceLines = trace.split( '\n' ),
1717
match = null;
1818

1919
// Loop over each line in the stack trace
@@ -85,7 +85,7 @@ jQuery( document ).ready( function( $ ) {
8585
* @param message
8686
*/
8787
function appendNoticeDisplay( message ) {
88-
const list = notice.find( '.jquery-migrate-deprecation-list' );
88+
var list = notice.find( '.jquery-migrate-deprecation-list' );
8989

9090
if ( ! notice.length ) {
9191
return;
@@ -122,7 +122,7 @@ jQuery( document ).ready( function( $ ) {
122122
return;
123123
}
124124

125-
let data = {
125+
var data = {
126126
action: 'jquery-migrate-log-notice',
127127
notice: message,
128128
nonce: JQMH.report_nonce,
@@ -158,8 +158,8 @@ jQuery( document ).ready( function( $ ) {
158158

159159
// Add handler for dismissing of the dashboard notice.
160160
$( document ).on( 'click', '.jquery-migrate-dashboard-notice .notice-dismiss', function() {
161-
const $notice = $( this ).closest( '.notice' );
162-
const notice_id = $notice.data( 'notice-id' );
161+
var $notice = $( this ).closest( '.notice' );
162+
var notice_id = $notice.data( 'notice-id' );
163163

164164
$.post( {
165165
url: window.ajaxurl,

0 commit comments

Comments
 (0)