Sha256: 60d01ae4bf098505c18cfe2cea23a5df9312670b6babe4fec8b4628b8154fce8

Contents?: true

Size: 609 Bytes

Versions: 6

Compression:

Stored size: 609 Bytes

Contents

<script>
  function ready(fn) {
    if (document.readyState !== 'loading') {
      fn()
    } else {
      document.addEventListener('DOMContentLoaded', fn)
    }
  }

  ready(() => {
    const subject = document.querySelector("[data-interaction-subject='<%= subject_id %>']")
    if (!subject) return

    const fetchStrategy = subject.getAttribute('data-fetch-strategy')

    if (fetchStrategy === 'local') {
      subject.setAttribute('data-ready', 'true')
      return
    }

    subject.addEventListener('loadend', (event) => {
      event.target.setAttribute('data-ready', 'true')
    })
  })
</script>

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
openproject-primer_view_components-0.49.2 previews/primer/alpha/select_panel_preview/_interaction_subject_js.html.erb
primer_view_components-0.35.2 previews/primer/alpha/select_panel_preview/_interaction_subject_js.html.erb
openproject-primer_view_components-0.49.1 previews/primer/alpha/select_panel_preview/_interaction_subject_js.html.erb
openproject-primer_view_components-0.49.0 previews/primer/alpha/select_panel_preview/_interaction_subject_js.html.erb
primer_view_components-0.35.1 previews/primer/alpha/select_panel_preview/_interaction_subject_js.html.erb
primer_view_components-0.35.0 previews/primer/alpha/select_panel_preview/_interaction_subject_js.html.erb