MCPcopy
hub / github.com/docsifyjs/docsify / _bindEventOnRendered

Method _bindEventOnRendered

src/core/render/index.js:287–301  ·  view source on GitHub ↗
(activeEl)

Source from the content-addressed store, hash-verified

285 }
286
287 _bindEventOnRendered(activeEl) {
288 const { autoHeader } = this.config;
289
290 scrollActiveSidebar(this.router);
291
292 if (autoHeader && activeEl) {
293 const main = dom.getNode('#main');
294 const firstNode = main.children[0];
295 if (firstNode && firstNode.tagName !== 'H1') {
296 const h1 = this.compiler.header(activeEl.innerText, 1);
297 const wrapper = dom.create('div', h1);
298 dom.before(main, wrapper.children[0]);
299 }
300 }
301 }
302
303 _renderNav(text) {
304 text && this._renderTo('nav', this.compiler.compile(text));

Callers 2

_renderSidebarMethod · 0.95
initFetchMethod · 0.80

Calls 2

scrollActiveSidebarFunction · 0.90
headerMethod · 0.80

Tested by

no test coverage detected