diff -r c7c34916027a -r 177826044cd9 wp/wp-admin/js/theme-plugin-editor.js --- a/wp/wp-admin/js/theme-plugin-editor.js Mon Oct 14 18:06:33 2019 +0200 +++ b/wp/wp-admin/js/theme-plugin-editor.js Mon Oct 14 18:28:13 2019 +0200 @@ -1,3 +1,7 @@ +/** + * @output wp-admin/js/theme-plugin-editor.js + */ + /* eslint no-magic-numbers: ["error", { "ignore": [-1, 0, 1] }] */ if ( ! window.wp ) { @@ -49,6 +53,8 @@ component.textarea = component.form.find( '#newcontent' ); component.textarea.on( 'change', component.onChange ); component.warning = $( '.file-editor-warning' ); + component.docsLookUpButton = component.form.find( '#docs-lookup' ); + component.docsLookUpList = component.form.find( '#docs-list' ); if ( component.warning.length > 0 ) { component.showWarning(); @@ -73,6 +79,15 @@ } return undefined; } ); + + component.docsLookUpList.on( 'change', function() { + var option = $( this ).val(); + if ( '' === option ) { + component.docsLookUpButton.prop( 'disabled', true ); + } else { + component.docsLookUpButton.prop( 'disabled', false ); + } + } ); }; /**