mirror of
https://github.com/docsifyjs/docsify.git
synced 2025-12-08 19:55:52 +00:00
fix(navbar): Now Navbar isn't append to DOM when loadNavbar is falsy (#407)
This commit is contained in:
parent
ec8daca3ec
commit
0933445e89
@ -6,7 +6,10 @@ import { scrollIntoView } from './scroll'
|
||||
export function eventMixin (proto) {
|
||||
proto.$resetEvents = function () {
|
||||
scrollIntoView(this.route.path, this.route.query.id)
|
||||
sidebar.getAndActive(this.router, 'nav')
|
||||
|
||||
if (this.config.loadNavbar) {
|
||||
sidebar.getAndActive(this.router, 'nav')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -117,7 +117,9 @@ export function renderMixin (proto) {
|
||||
|
||||
proto._renderNav = function (text) {
|
||||
text && this._renderTo('nav', this.compiler.compile(text))
|
||||
getAndActive(this.router, 'nav')
|
||||
if (this.config.loadNavbar) {
|
||||
getAndActive(this.router, 'nav')
|
||||
}
|
||||
}
|
||||
|
||||
proto._renderMain = function (text, opt = {}, next) {
|
||||
@ -238,7 +240,9 @@ export function initRender (vm) {
|
||||
}
|
||||
|
||||
// Add nav
|
||||
dom.before(navAppendToTarget, navEl)
|
||||
if (config.loadNavbar) {
|
||||
dom.before(navAppendToTarget, navEl)
|
||||
}
|
||||
|
||||
if (config.themeColor) {
|
||||
dom.$.head.appendChild(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user