1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Added a view for the API docs

This commit is contained in:
Dan Brown
2020-01-15 20:18:02 +00:00
parent bed2498667
commit 45b5e631e2
9 changed files with 133 additions and 13 deletions

View File

@ -0,0 +1,18 @@
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;