Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions assets/js/plugin-check-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,26 @@
return;
}

// Handle disabling the Check it button when a plugin is not selected.
function canRunChecks() {
if ( '' === pluginsList.value ) {
checkItButton.disabled = true;
} else {
checkItButton.disabled = false;
}
}
Comment thread
felixarntz marked this conversation as resolved.

// Run on page load to test if dropdown is auto populated.
canRunChecks();
pluginsList.addEventListener( 'change', canRunChecks );

// When the Check it button is clicked.
checkItButton.addEventListener( 'click', ( e ) => {
e.preventDefault();

resetResults();
checkItButton.disabled = true;
pluginsList.disabled = true;
spinner.classList.add( 'is-active' );

getChecksToRun()
Expand Down Expand Up @@ -54,6 +69,7 @@
function resetForm() {
spinner.classList.remove( 'is-active' );
checkItButton.disabled = false;
pluginsList.disabled = false;
}

/**
Expand Down