Sha256: 220c54e91d628bd27da8dd0efb659b01f8c355967d4e52b447cfdadd74accc9b
Contents?: true
Size: 659 Bytes
Versions: 7
Compression:
Stored size: 659 Bytes
Contents
import { Controller } from '@hotwired/stimulus' import * as bootstrap from 'bootstrap' export default class extends Controller { tooltip = null connect () { if (this.element.dataset.bsTrigger === 'contextmenu') { this.element.addEventListener('contextmenu', (ev) => { ev.preventDefault() if (!this.tooltip) { this.tooltip = new bootstrap.Tooltip(this.element, { trigger: 'focus' }) this.tooltip.show() } }) } else { this.tooltip = new bootstrap.Tooltip(this.element) } } disconnect () { if (this.tooltip) { this.tooltip.dispose() } } }
Version data entries
7 entries across 7 versions & 1 rubygems