aboutsummaryrefslogtreecommitdiffhomepage
path: root/assets/default
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-10-11 13:34:38 +0200
committerArthurHoaro <arthur@hoa.ro>2020-10-27 20:11:30 +0100
commit25e90d8d75382721ff7473fa1686090fcfeb46ff (patch)
treeaad18c29535d62b81c7991c4ae916bd596761ee6 /assets/default
parent5d8de7587d67b5c3e5d1fed8562d9b87ecde80c1 (diff)
downloadShaarli-25e90d8d75382721ff7473fa1686090fcfeb46ff.tar.gz
Shaarli-25e90d8d75382721ff7473fa1686090fcfeb46ff.tar.zst
Shaarli-25e90d8d75382721ff7473fa1686090fcfeb46ff.zip
Bulk creation: fix private status based on the first form
Diffstat (limited to 'assets/default')
-rw-r--r--assets/default/js/base.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/assets/default/js/base.js b/assets/default/js/base.js
index 9161b4fc..4163577d 100644
--- a/assets/default/js/base.js
+++ b/assets/default/js/base.js
@@ -654,5 +654,13 @@ function init(description) {
654 e.preventDefault(); 654 e.preventDefault();
655 toggleBulkCreationVisibility(bulkCreationButton, bulkCreationForm); 655 toggleBulkCreationVisibility(bulkCreationButton, bulkCreationForm);
656 }); 656 });
657
658 // Force to send falsy value if the checkbox is not checked.
659 const privateButton = bulkCreationForm.querySelector('input[type="checkbox"][name="private"]');
660 const privateHiddenButton = bulkCreationForm.querySelector('input[type="hidden"][name="private"]');
661 privateButton.addEventListener('click', () => {
662 privateHiddenButton.disabled = !privateHiddenButton.disabled;
663 });
664 privateHiddenButton.disabled = privateButton.checked;
657 } 665 }
658})(); 666})();