ui: Fix dark theme colors for running status indicator

Tests:

- Insert event.preventDefault() in form submission code for submission buttons.

- For various button styles, submit the form. Running status indicator appears
on the form button. The styles for the indicator is appropriate in dark and
light themes.

  - Calibre delete library confirmation page has btn-danger.

  - Software Update, configuration update button has btn-primary.

  - Software Update, 'update now' button has btn-default.

  - Change a button from btn-primary to btn-link. Running status is not shown
  for this type of button.

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2025-11-29 10:55:28 +05:30 committed by James Valleroy
parent 4bbe53e9ff
commit 85f04dde1a
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
2 changed files with 9 additions and 2 deletions

View File

@ -739,8 +739,8 @@ footer {
*/
.running-status-button-before {
display: inline-block;
border: 0.25rem solid var(--neutral-light-color);
border-top: 0.25rem solid var(--progress-color);
border: 0.25rem solid var(--bs-btn-color);
border-top-color: transparent;
border-radius: 50%;
width: 1rem;
height: 1rem;
@ -748,6 +748,8 @@ footer {
margin-left: 0.625rem;
margin-bottom: -0.25rem;
margin-right: -1.625rem;
position: relative;
z-index: 10;
}
.running-status-button:disabled {

View File

@ -85,6 +85,11 @@ function onSubmitAddProgress(event) {
// For push buttons
const beforeElement = document.createElement('div');
beforeElement.classList.add('running-status-button-before');
button.classList.forEach(className => {
if (className.startsWith('btn-')) {
beforeElement.classList.add(className);
}
});
button.parentNode.insertBefore(beforeElement, button);
} else if (button.tagName == "BUTTON") {
// For toggle buttons