diff options
| author | Marijn Tamis <[email protected]> | 2017-04-28 14:19:07 +0200 |
|---|---|---|
| committer | Marijn Tamis <[email protected]> | 2017-04-28 14:19:07 +0200 |
| commit | b350eb5f4d44e8448115796144375d79438d74ae (patch) | |
| tree | 8e102e8c28f45a1b87bd335ceee4f33c3d4ee7c2 /NvCloth/docs/documentation/_static/sidebar.js | |
| parent | Add visual samples. (diff) | |
| download | nvcloth-b350eb5f4d44e8448115796144375d79438d74ae.tar.xz nvcloth-b350eb5f4d44e8448115796144375d79438d74ae.zip | |
NvCloth 1.1.0 Release. (22041545)
Diffstat (limited to 'NvCloth/docs/documentation/_static/sidebar.js')
| -rw-r--r-- | NvCloth/docs/documentation/_static/sidebar.js | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/NvCloth/docs/documentation/_static/sidebar.js b/NvCloth/docs/documentation/_static/sidebar.js index be206ed..874a890 100644 --- a/NvCloth/docs/documentation/_static/sidebar.js +++ b/NvCloth/docs/documentation/_static/sidebar.js @@ -16,12 +16,20 @@ * Once the browser is closed the cookie is deleted and the position * reset to the default (expanded). * - * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ $(function() { + + + + + + + + // global elements used by the functions. // the 'sidebarbutton' element is defined as global after its // creation, in the add_sidebar_button function @@ -29,6 +37,9 @@ $(function() { var sidebar = $('.sphinxsidebar'); var sidebarwrapper = $('.sphinxsidebarwrapper'); + // for some reason, the document has no sidebar; do not run into errors + if (!sidebar.length) return; + // original margin-left of the bodywrapper and width of the sidebar // with the sidebar expanded var bw_margin_expanded = bodywrapper.css('margin-left'); @@ -91,6 +102,7 @@ $(function() { '<div id="sidebarbutton"><span>«</span></div>' ); var sidebarbutton = $('#sidebarbutton'); + light_color = sidebarbutton.css('background-color'); // find the height of the viewport to center the '<<' in the page var viewport_height; if (window.innerHeight) @@ -130,7 +142,7 @@ $(function() { var items = document.cookie.split(';'); for(var k=0; k<items.length; k++) { var key_val = items[k].split('='); - var key = key_val[0]; + var key = key_val[0].replace(/ /, ""); // strip leading spaces if (key == 'sidebar') { var value = key_val[1]; if ((value == 'collapsed') && (!sidebar_is_collapsed())) |