Skip to content

Commit 67a89a7

Browse files
author
pento
committed
Plugin Editor: Disable the documentation look up button when no function is selected.
Props xkon. Fixes #41143. Built from https://develop.svn.wordpress.org/trunk@44617 git-svn-id: http://core.svn.wordpress.org/trunk@44448 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 parent 67d619b commit 67a89a7

File tree

5 files changed

+15
-4
lines changed

5 files changed

+15
-4
lines changed

wp-admin/js/theme-plugin-editor.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ wp.themePluginEditor = (function( $ ) {
5353
component.textarea = component.form.find( '#newcontent' );
5454
component.textarea.on( 'change', component.onChange );
5555
component.warning = $( '.file-editor-warning' );
56+
component.docsLookUpButton = component.form.find( '#docs-lookup' );
57+
component.docsLookUpList = component.form.find( '#docs-list' );
5658

5759
if ( component.warning.length > 0 ) {
5860
component.showWarning();
@@ -77,6 +79,15 @@ wp.themePluginEditor = (function( $ ) {
7779
}
7880
return undefined;
7981
} );
82+
83+
component.docsLookUpList.on( 'change', function() {
84+
var option = $( this ).val();
85+
if ( '' === option ) {
86+
component.docsLookUpButton.prop( 'disabled', true );
87+
} else {
88+
component.docsLookUpButton.prop( 'disabled', false );
89+
}
90+
} );
8091
};
8192

8293
/**

0 commit comments

Comments
 (0)