-import * as DOM from '../services/dom';
-import {scrollAndHighlightElement} from '../services/util';
+import * as DOM from '../services/dom.ts';
+import {scrollAndHighlightElement} from '../services/util.ts';
import {Component} from './component';
function toggleAnchorHighlighting(elementId, shouldHighlight) {
window.importVersioned('code').then(Code => Code.highlight());
this.setupNavHighlighting();
- this.setupDetailsCodeBlockRefresh();
// Check the hash on load
if (window.location.hash) {
}
}
- setupDetailsCodeBlockRefresh() {
- const onToggle = event => {
- const codeMirrors = [...event.target.querySelectorAll('.CodeMirror')];
- codeMirrors.forEach(cm => cm.CodeMirror && cm.CodeMirror.refresh());
- };
-
- const details = [...this.container.querySelectorAll('details')];
- details.forEach(detail => detail.addEventListener('toggle', onToggle));
- }
-
}