summaryrefslogtreecommitdiffstats
path: root/ogcp/static/js
diff options
context:
space:
mode:
authorJavier Sánchez Parra <jsanchez@soleta.eu>2022-03-08 16:52:11 +0100
committerJavier Sánchez Parra <jsanchez@soleta.eu>2022-03-09 17:08:33 +0100
commitd7b19c6aa0c9502585a5b97bccc8dd312095e3db (patch)
tree88390f9150c5551dae18dcb7f101c9d0001c014e /ogcp/static/js
parent6b3b37e2f34e6eb9bbc29c458525eb4c2b07d059 (diff)
Remove common css classes from pills status update
Some css classes are common to all pills statuses, so we do not need to add or delete those classes on status change. It also remove "badge-info" class because is never used.
Diffstat (limited to 'ogcp/static/js')
-rw-r--r--ogcp/static/js/ogcp.js15
1 files changed, 6 insertions, 9 deletions
diff --git a/ogcp/static/js/ogcp.js b/ogcp/static/js/ogcp.js
index 7cfa59d..00b451c 100644
--- a/ogcp/static/js/ogcp.js
+++ b/ogcp/static/js/ogcp.js
@@ -105,23 +105,20 @@ function updateScopeState() {
}
function updatePillStatus(state, pill) {
- const pillCls = ['badge', 'badge-pill', 'badge-info',
- 'badge-danger', 'badge-success', 'badge-warning',
+ const pillCls = ['badge-danger', 'badge-success', 'badge-warning',
'badge-wol', 'badge-light'];
pill.classList.remove(...pillCls);
- let newPillCls = [];
if (state === 'OPG') {
- newPillCls.push('badge', 'badge-pill', 'badge-warning');
+ pill.classList.add('badge-warning');
} else if (state === 'BSY') {
- newPillCls.push('badge', 'badge-pill', 'badge-danger');
+ pill.classList.add('badge-danger');
} else if (state === 'VDI') {
- newPillCls.push('badge', 'badge-pill', 'badge-success');
+ pill.classList.add('badge-success');
} else if (state === 'WOL_SENT') {
- newPillCls.push('badge', 'badge-pill', 'badge-wol');
+ pill.classList.add('badge-wol');
} else {
- newPillCls.push('badge', 'badge-pill', 'badge-light');
+ pill.classList.add('badge-light');
}
- pill.classList.add(...newPillCls);
}
function updateScopes(scopes) {