Skip to content

Commit 1606cb0

Browse files
committed
Media: Fix a jQuery Migrate warning for disabled buttons.
Under jQuery 4.0, disabling a media button or the image cropper's action button triggered a jQuery Migrate warning about the boolean `disabled` attribute. These buttons now toggle the `disabled` property instead, which removes the warning and keeps the behavior unchanged. Developed in: #10661 Props audrasjb, azaozz, hbhalodia, neo2k23, wildworks. See #64425. git-svn-id: https://develop.svn.wordpress.org/trunk@62963 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 455fb3f commit 1606cb0

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/js/media/controllers/cropper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ Cropper = wp.media.controller.State.extend(/** @lends wp.media.controller.Croppe
116116
selection.set({cropDetails: controller.state().imgSelect.getSelection()});
117117

118118
this.$el.text(l10n.cropping);
119-
this.$el.attr('disabled', true);
119+
this.$el.prop( 'disabled', true );
120120

121121
controller.state().doCrop( selection ).done( function( croppedImage ) {
122122
controller.trigger('cropped', croppedImage );

src/js/media/views/button.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ var Button = wp.media.View.extend(/** @lends wp.media.view.Button.prototype */{
6464
classes = _.uniq( classes.concat( this.options.classes ) );
6565
this.el.className = classes.join(' ');
6666

67-
this.$el.attr( 'disabled', model.disabled );
67+
this.$el.prop( 'disabled', model.disabled );
6868
this.$el.text( this.model.get('text') );
6969

7070
return this;

0 commit comments

Comments
 (0)