Skip to content

Commit

Permalink
Change description to let user know why UI is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
rebeccahum committed Sep 27, 2023
1 parent df3fb66 commit d714c65
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions security/class-private-sites.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,22 @@ function disableButton(selector) {
}
}
function updateDescription(message) {
var description = document.querySelector('tr.option-site-visibility p.description');
if (description) {
description.textContent = message;
}
}
var checkbox = 'tr.option-site-visibility input#blog_public[type=\"checkbox\"]';
var description = document.querySelector('tr.option-site-visibility p.description');
if (document.querySelector(checkbox)) {
disableButton(checkbox);
updateDescription('This option is disabled when the constant \"VIP_JETPACK_IS_PRIVATE\" is enabled.');
} else {
disableButton('tr.option-site-visibility input#blog-public[type=\"radio\"]');
disableButton('tr.option-site-visibility input#blog-norobots[type=\"radio\"]');
updateDescription('These options are disabled when \"VIP_JETPACK_IS_PRIVATE\" is enabled.');
}
});" );
}
Expand Down

0 comments on commit d714c65

Please sign in to comment.