Upload: improve legacy SWFUpload event handlers for current jQuery.

Fix an issue where legacy JavaScript for SWFUpload still used jQuery's 
deprecated `live` event which no longer works - switch to using `on`.
This JavaScript is still used by some plugins and themes.

Props MMDeveloper.
Fixes #39886.



git-svn-id: https://develop.svn.wordpress.org/trunk@40431 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Adam Silverstein 2017-04-14 16:42:16 +00:00
parent a92edf9e9a
commit 0bdd57140b
1 changed files with 2 additions and 2 deletions

View File

@ -356,7 +356,7 @@ function cancelUpload() {
// remember the last used image size, alignment and url
jQuery(document).ready(function($){
$('input[type="radio"]', '#media-items').live('click', function(){
$( 'input[type="radio"]', '#media-items' ).on( 'click', function(){
var tr = $(this).closest('tr');
if ( $(tr).hasClass('align') )
@ -365,7 +365,7 @@ jQuery(document).ready(function($){
setUserSetting('imgsize', $(this).val());
});
$('button.button', '#media-items').live('click', function(){
$( 'button.button', '#media-items' ).on( 'click', function(){
var c = this.className || '';
c = c.match(/url([^ '"]+)/);
if ( c && c[1] ) {