mirror of
https://github.com/dalbodeule/snap-admin.git
synced 2025-08-14 23:51:12 +00:00
@DisableDelete
WIP
This commit is contained in:
@@ -30,6 +30,15 @@ a {
|
||||
background: #EDECEF;
|
||||
}
|
||||
|
||||
.btn-secondary.disable {
|
||||
background-color: #A8ADB3;
|
||||
border: 1px solid #A8ADB3;
|
||||
}
|
||||
|
||||
form.delete-form button.disable .bi {
|
||||
color: #9298A0 !important;
|
||||
}
|
||||
|
||||
.null-label {
|
||||
background-color: #EEE;
|
||||
border-radius: 5px;
|
||||
|
@@ -1,7 +1,16 @@
|
||||
function updateBulkActions(table, selected) {
|
||||
let deleteEnabled = table.dataset.deleteenabled;
|
||||
|
||||
let divs = document.querySelectorAll(".bulk-actions");
|
||||
divs.forEach(div => {
|
||||
div.innerHTML = `${selected} items selected <input type="submit" form="multi-delete-form" class="ui-btn btn btn-secondary" value="Delete">`;
|
||||
if (deleteEnabled === "true") {
|
||||
div.innerHTML = `${selected} items selected
|
||||
<input type="submit" form="multi-delete-form"
|
||||
class="ui-btn btn btn-secondary ${deleteEnabled === "false" ? 'disable' : ''} " value="Delete">`;
|
||||
} else {
|
||||
|
||||
div.innerHTML = `<p class="text-muted m-0 mt-1">DELETE not allowed on this table</p>`;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user