diff --git a/app/javascript/retrospring/controllers/tooltip_controller.ts b/app/javascript/retrospring/controllers/tooltip_controller.ts new file mode 100644 index 00000000..a6c61fa0 --- /dev/null +++ b/app/javascript/retrospring/controllers/tooltip_controller.ts @@ -0,0 +1,8 @@ +import { Controller } from '@hotwired/stimulus'; +import { Tooltip } from 'bootstrap'; + +export default class extends Controller { + connect(): void { + new Tooltip(this.element); + } +} diff --git a/app/javascript/retrospring/initializers/stimulus.ts b/app/javascript/retrospring/initializers/stimulus.ts index 505d23ad..0c775324 100644 --- a/app/javascript/retrospring/initializers/stimulus.ts +++ b/app/javascript/retrospring/initializers/stimulus.ts @@ -17,6 +17,7 @@ import ShareController from "retrospring/controllers/share_controller"; import ClipboardController from "retrospring/controllers/clipboard_controller"; import QuestionboxFocusController from "retrospring/controllers/questionbox_focus_controller"; import ReactionController from "retrospring/controllers/reaction_controller"; +import TooltipController from "retrospring/controllers/tooltip_controller"; /** * This module sets up Stimulus and our controllers @@ -45,4 +46,5 @@ export default function (): void { window['Stimulus'].register('clipboard', ClipboardController); window['Stimulus'].register('questionbox-focus', QuestionboxFocusController); window['Stimulus'].register('reaction', ReactionController); + window['Stimulus'].register('tooltip', TooltipController); }