webmcp

diff doc/autodoc-header.htmlpart @ 389:a7a335e2db93

Utilize onhashchange event in autodoc output
author jbe
date Thu Dec 03 02:32:20 2015 +0100 (2015-12-03)
parents 29eeba26ff9f
children ed910089a0c5
line diff
     1.1 --- a/doc/autodoc-header.htmlpart	Wed Dec 02 09:37:47 2015 +0100
     1.2 +++ b/doc/autodoc-header.htmlpart	Thu Dec 03 02:32:20 2015 +0100
     1.3 @@ -1,13 +1,23 @@
     1.4  <html>
     1.5    <head>
     1.6      <script type="text/javascript">
     1.7 -      window.onload = function() {
     1.8 -        if (window.location.hash) {
     1.9 -          var encoded_hash = window.location.hash.replace(/^#/, '').replace(/_/g, '_USC_').replace(/\./g, '_DOT_').replace(/:/g, '_COL_');
    1.10 -          var element = document.getElementById('autodoc_details_' + encoded_hash);
    1.11 -          if (element) element.style.display = '';
    1.12 +      var openedSection = null;
    1.13 +      var setSectionDisplay = function(disp) {
    1.14 +        var element = document.getElementById('autodoc_details_' + openedSection);
    1.15 +        if (element) element.style.display = disp;
    1.16 +      };
    1.17 +      var showSection = function() {
    1.18 +        openedSection = window.location.hash;
    1.19 +        if (openedSection) {
    1.20 +          openedSection = openedSection.replace(/^#/, '').replace(/_/g, '_USC_').replace(/\./g, '_DOT_').replace(/:/g, '_COL_');
    1.21 +          setSectionDisplay('');
    1.22          }
    1.23 -      }
    1.24 +      };
    1.25 +      window.onload = showSection;
    1.26 +      window.onhashchange = function() {
    1.27 +        setSectionDisplay('none');
    1.28 +        showSection();
    1.29 +      };
    1.30      </script>
    1.31      <style>
    1.32        body {

Impressum / About Us