mirror of
https://github.com/MarijnDoeve/TijdVoorDeTest.git
synced 2026-07-12 21:05:19 +02:00
a4f8340b04
Compiles assets/*.ts via sensiolabs/typescript-bundle (standalone SWC binary) and adds Deno for formatting, linting, type-checking, and tests, keeping the project's no-Node/npm approach intact. Wires all four into CI, the Justfile, and the pre-commit hook.
36 lines
1005 B
TypeScript
36 lines
1005 B
TypeScript
import { Controller } from '@hotwired/stimulus';
|
|
import { Modal, Tooltip } from 'bootstrap';
|
|
|
|
export default class extends Controller {
|
|
static targets = ['clearModal', 'deleteModal'];
|
|
|
|
declare readonly clearModalTarget: HTMLElement;
|
|
declare readonly deleteModalTarget: HTMLElement;
|
|
|
|
tooltips: Tooltip[] = [];
|
|
|
|
connect(): void {
|
|
this.tooltips = [];
|
|
const tooltipTriggerList = this.element.querySelectorAll(
|
|
'[data-bs-toggle="tooltip"]',
|
|
);
|
|
[...tooltipTriggerList].forEach((tooltipTriggerEl) => {
|
|
this.tooltips.push(Tooltip.getOrCreateInstance(tooltipTriggerEl));
|
|
});
|
|
}
|
|
|
|
disconnect(): void {
|
|
this.tooltips.forEach((tooltip) => tooltip.dispose());
|
|
}
|
|
|
|
clearQuiz(): void {
|
|
const modal = Modal.getOrCreateInstance(this.clearModalTarget);
|
|
modal.show();
|
|
}
|
|
|
|
deleteQuiz(): void {
|
|
const modal = Modal.getOrCreateInstance(this.deleteModalTarget);
|
|
modal.show();
|
|
}
|
|
}
|