Sha256: 85ae6a396a58ea8b483b2ade6c4d0cef66c2d18fc6546fe270939e34aefabf06
Contents?: true
Size: 806 Bytes
Versions: 21
Compression:
Stored size: 806 Bytes
Contents
// Visibility toggle for items in an exhibit, based on Blacklight's bookmark toggle // See: https://github.com/projectblacklight/blacklight/blob/main/app/javascript/blacklight/bookmark_toggle.js import CheckboxSubmit from 'spotlight/admin/checkbox_submit' const VisibilityToggle = (e) => { if (e.target.matches('[data-checkboxsubmit-target="checkbox"]')) { const form = e.target.closest('form') if (form) { new CheckboxSubmit(form).clicked(e) // Add/remove the "private" label to the document row when visibility is toggled const docRow = form.closest('tr') if (docRow) docRow.classList.toggle('blacklight-private') } } } VisibilityToggle.selector = 'form.visibility-toggle' document.addEventListener('click', VisibilityToggle) export default VisibilityToggle
Version data entries
21 entries across 21 versions & 1 rubygems