From 450f04d4ad34ff64220732711251884ee4d575f7 Mon Sep 17 00:00:00 2001 From: Paul Biron Date: Tue, 12 May 2020 16:49:12 -0600 Subject: [PATCH] Use ES5 in the JS, because the core build tools barf on `let` and `const`. --- js/wp-autoupdates.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/js/wp-autoupdates.js b/js/wp-autoupdates.js index 8f7af37..9bf7ebe 100644 --- a/js/wp-autoupdates.js +++ b/js/wp-autoupdates.js @@ -10,8 +10,8 @@ 'click', '.toggle-auto-update', function( event ) { - let data, asset, type; - const $anchor = $( this ), + var data, asset, type, + $anchor = $( this ), action = $anchor.attr( 'data-wp-action' ), $label = $anchor.find( '.label' ), $parent = $anchor.parents( @@ -56,13 +56,13 @@ action: 'toggle-auto-updates', _ajax_nonce: settings.ajax_nonce, state: action, - type, - asset, + type: type, + asset: asset, }; $.post( window.ajaxurl, data ) .done( function( response ) { - let $enabled, $disabled, enabledNumber, disabledNumber, errorMessage; + var $enabled, $disabled, enabledNumber, disabledNumber, errorMessage; if ( response.success ) { // Update the counts in the enabled/disabled views if on on