Add Stimulus tooltip controller

This commit is contained in:
Andreas Nedbal 2024-03-10 15:28:24 +01:00 committed by Andreas Nedbal
parent 96794029b3
commit 94f027f546
2 changed files with 10 additions and 0 deletions

View File

@ -0,0 +1,8 @@
import { Controller } from '@hotwired/stimulus';
import { Tooltip } from 'bootstrap';
export default class extends Controller {
connect(): void {
new Tooltip(this.element);
}
}

View File

@ -17,6 +17,7 @@ import ShareController from "retrospring/controllers/share_controller";
import ClipboardController from "retrospring/controllers/clipboard_controller"; import ClipboardController from "retrospring/controllers/clipboard_controller";
import QuestionboxFocusController from "retrospring/controllers/questionbox_focus_controller"; import QuestionboxFocusController from "retrospring/controllers/questionbox_focus_controller";
import ReactionController from "retrospring/controllers/reaction_controller"; import ReactionController from "retrospring/controllers/reaction_controller";
import TooltipController from "retrospring/controllers/tooltip_controller";
/** /**
* This module sets up Stimulus and our controllers * This module sets up Stimulus and our controllers
@ -45,4 +46,5 @@ export default function (): void {
window['Stimulus'].register('clipboard', ClipboardController); window['Stimulus'].register('clipboard', ClipboardController);
window['Stimulus'].register('questionbox-focus', QuestionboxFocusController); window['Stimulus'].register('questionbox-focus', QuestionboxFocusController);
window['Stimulus'].register('reaction', ReactionController); window['Stimulus'].register('reaction', ReactionController);
window['Stimulus'].register('tooltip', TooltipController);
} }