0
0
Fork 0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-04-16 01:34:12 +00:00
BookStackApp_BookStack/resources/js/components/details-highlighter.js
2020-01-15 20:18:02 +00:00

18 lines
No EOL
389 B
JavaScript

import Code from "../services/code"
class DetailsHighlighter {
constructor(elem) {
this.elem = elem;
this.dealtWith = false;
elem.addEventListener('toggle', this.onToggle.bind(this));
}
onToggle() {
if (this.dealtWith) return;
Code.highlightWithin(this.elem);
this.dealtWith = true;
}
}
export default DetailsHighlighter;