Sha256: e5d95a8b7292c28fe3f933bf289f42c0569076441fb3f8941c83ba000be05eb9

Contents?: true

Size: 624 Bytes

Versions: 5

Compression:

Stored size: 624 Bytes

Contents

import Blacklight from './core'
import CheckboxSubmit from './checkbox_submit'

const BookmarkToggle = (() => {
    // change form submit toggle to checkbox
    Blacklight.doBookmarkToggleBehavior = function() {
      document.addEventListener('click', (e) => {
        if (e.target.matches('[data-checkboxsubmit-target="checkbox"]')) {
          const form = e.target.closest('form')
          if (form) new CheckboxSubmit(form).clicked(e);
        }
      });
    };
    Blacklight.doBookmarkToggleBehavior.selector = 'form.bookmark-toggle';

    Blacklight.doBookmarkToggleBehavior();
})()

export default BookmarkToggle

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
blacklight-8.0.0.beta5 app/javascript/blacklight/bookmark_toggle.js
blacklight-8.0.0.beta4 app/javascript/blacklight/bookmark_toggle.js
blacklight-8.0.0.beta3 app/javascript/blacklight/bookmark_toggle.js
blacklight-8.0.0.beta2 app/javascript/blacklight/bookmark_toggle.js
blacklight-8.0.0.beta1 app/javascript/blacklight/bookmark_toggle.js