Sha256: fa6b16d27662ebd0b5d0b59cc6d2be1db15254e85f1c4a11a61fc0f2269b5718

Contents?: true

Size: 451 Bytes

Versions: 8

Compression:

Stored size: 451 Bytes

Contents

export default class DataConfirm {
  onSubmit = event => {
    if (!event.target.matches('[data-turbo=true]') && 'confirm' in event.submitter.dataset) {
      const v = event.submitter.dataset.confirm

      if (v !== 'false' && !confirm(v === 'true' || v === '' ? 'Are you sure?' : v)) {
        event.preventDefault()
        event.stopPropagation()
        event.stopImmediatePropagation()
        return false
      }
    }

    return true
  }
}

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
proscenium-0.15.0.beta.5-x86_64-linux lib/proscenium/libs/ujs/data_confirm.js
proscenium-0.15.0.beta.5-aarch64-linux lib/proscenium/libs/ujs/data_confirm.js
proscenium-0.15.0.beta.5-arm64-darwin lib/proscenium/libs/ujs/data_confirm.js
proscenium-0.15.0.beta.5-x86_64-darwin lib/proscenium/libs/ujs/data_confirm.js
proscenium-0.15.0.beta.4-x86_64-linux lib/proscenium/libs/ujs/data_confirm.js
proscenium-0.15.0.beta.4-aarch64-linux lib/proscenium/libs/ujs/data_confirm.js
proscenium-0.15.0.beta.4-arm64-darwin lib/proscenium/libs/ujs/data_confirm.js
proscenium-0.15.0.beta.4-x86_64-darwin lib/proscenium/libs/ujs/data_confirm.js