Retrospring/app/javascript/retrospring/controllers/format_popup_controller.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
493 B
TypeScript
Raw Normal View History

import { Controller } from '@hotwired/stimulus';
import { Popover } from 'bootstrap';
export default class extends Controller {
connect(): void {
const formatOptionsElement = document.getElementById('formatting-options');
this.element.addEventListener('click', e => e.preventDefault());
new Popover(this.element, {
html: true,
content: formatOptionsElement.innerHTML,
placement: 'bottom',
trigger: 'focus',
customClass: 'rs-popover'
})
}
}