Make modals static. Hide some settings. Minor optimizations. Switch from NPM bach to CDN.
This commit is contained in:
@@ -2,10 +2,11 @@ const swalClasses = {
|
||||
container: 'text-center',
|
||||
confirmButton: 'btn btn-lg btn-primary',
|
||||
cancelButton: 'btn btn-lg btn-secondary ms-3',
|
||||
denyButton: 'btn btn-lg btn-secondary ms-3',
|
||||
popup: 'border p-5',
|
||||
title: 'fs-2',
|
||||
inputLabel: 'fs-5',
|
||||
htmlContainer: 'fs-5'
|
||||
inputLabel: 'fs-5 text-secondary-emphasis',
|
||||
htmlContainer: 'fs-5 text-center text-secondary-emphasis',
|
||||
};
|
||||
|
||||
function showSingleCalcDialog(btn) {
|
||||
@@ -21,7 +22,7 @@ function showSingleCalcDialog(btn) {
|
||||
buttonsStyling: false
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
htmx.ajax('POST', '/score/' + result.value, {target: '#' + btn.id, swap: 'none'})
|
||||
let promise = htmx.ajax('POST', '/score/' + result.value, {target: '#' + btn.id, swap: 'none'});
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -72,7 +73,7 @@ function confirmAndTrigger(btn) {
|
||||
buttonsStyling: false
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
htmx.trigger(btn, 'confirmed');
|
||||
htmx.trigger(btn, 'confirmed', null);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -94,7 +95,7 @@ function createCodeDialog(btn) {
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
btn.setAttribute('hx-vals', '{"user_role": "' + result.value + '"}');
|
||||
htmx.trigger(btn, 'confirmed');
|
||||
htmx.trigger(btn, 'confirmed', null);
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user