Skip to content
Snippets Groups Projects
Commit 9546e5e3 authored by Frank Steinberg's avatar Frank Steinberg
Browse files

Allow positioning in web page, e.g. "...show.html#1A".

parent 48075c94
No related branches found
No related tags found
No related merge requests found
...@@ -8,6 +8,18 @@ xhr1.onreadystatechange = function() { ...@@ -8,6 +8,18 @@ xhr1.onreadystatechange = function() {
if (xhr1.readyState === 4) { if (xhr1.readyState === 4) {
styleguide = xhr1.responseXML.querySelector("styleguide"); styleguide = xhr1.responseXML.querySelector("styleguide");
renderStyleguide(styleguide); renderStyleguide(styleguide);
if (window.location.href.indexOf("#") > -1) {
idref = window.location.href.replace(/^.*#/g, '');
var node = document.querySelector("*[id='" + idref + "']");
node.classList.remove("collapsed");
if ((node.parentNode.tagName == "subcategory") || (node.parentNode.tagName == "category")) {
node.parentNode.classList.remove("collapsed");
if (node.parentNode.parentNode.tagName == "category") {
node.parentNode.parentNode.classList.remove("collapsed");
}
}
window.location.href = "#" + idref;
}
} }
} }
xhr1.open('GET', document.querySelector('link[rel="styleguide"]').href, true); xhr1.open('GET', document.querySelector('link[rel="styleguide"]').href, true);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment