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