Media: Disable the edit image->replace button when no item selected.

On the edit media screen, ensure that the 'replace' button is disabled until a media item is selected. Fix an issue where clicking the button with no item selected threw a JavaScript error and failed to work.

Props timmydcrawford, subrataemfluence, psiico.
Fixes #40589.



git-svn-id: https://develop.svn.wordpress.org/trunk@40902 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Adam Silverstein 2017-06-15 09:37:53 +00:00
parent e67238f480
commit b13ab6b4a3
2 changed files with 2 additions and 0 deletions

View File

@ -5116,6 +5116,7 @@ ImageDetails = Select.extend({
style: 'primary',
text: l10n.replace,
priority: 80,
requires: { selection: true },
click: function() {
var controller = this.controller,

View File

@ -146,6 +146,7 @@ ImageDetails = Select.extend({
style: 'primary',
text: l10n.replace,
priority: 80,
requires: { selection: true },
click: function() {
var controller = this.controller,