Fix: not removing old readme before adding new one
This commit is contained in:
parent
6aa044cf9b
commit
cdceca576f
1 changed files with 6 additions and 6 deletions
12
js/main.js
12
js/main.js
|
@ -204,16 +204,16 @@ $(document).ready(function () {
|
||||||
history.replaceState(null, path, '#' + path);
|
history.replaceState(null, path, '#' + path);
|
||||||
|
|
||||||
if (path) {
|
if (path) {
|
||||||
var readmePath = getREADMEmdFile(filesData, path);
|
|
||||||
if (readmePath) {
|
|
||||||
var zeroMdElement = document.createElement("zero-md");
|
|
||||||
zeroMdElement.setAttribute("src", filesBaseUrl + readmePath);
|
|
||||||
document.querySelector("body > div.container").appendChild(zeroMdElement);
|
|
||||||
} else {
|
|
||||||
var zeroMdElement = document.querySelector("zero-md");
|
var zeroMdElement = document.querySelector("zero-md");
|
||||||
if (zeroMdElement) {
|
if (zeroMdElement) {
|
||||||
document.querySelector("body > div.container").removeChild(zeroMdElement);
|
document.querySelector("body > div.container").removeChild(zeroMdElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var readmePath = getREADMEmdFile(filesData, path);
|
||||||
|
if (readmePath) {
|
||||||
|
zeroMdElement = document.createElement("zero-md");
|
||||||
|
zeroMdElement.setAttribute("src", filesBaseUrl + readmePath);
|
||||||
|
document.querySelector("body > div.container").appendChild(zeroMdElement);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue