summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/_themes
diff options
context:
space:
mode:
authorHongyi Zhang <hongyi73.zhang@gmail.com>2015-10-16 09:57:08 +0200
committerHongyi Zhang <hongyi73.zhang@gmail.com>2015-10-16 09:57:08 +0200
commit89c7123621f22533e1777796237a9b06bd190976 (patch)
tree049a6bc8eb24d61139edb7cb496a56f0f96d06a2 /user_guide_src/source/_themes
parent406ce65e26c4fda1b840b7267b148228cc3ca2f2 (diff)
revert img alt changes, fix cookies, and improve pulldown menu in multiple screen size
Signed-off-by: Hongyi Zhang <hongyi73.zhang@gmail.com>
Diffstat (limited to 'user_guide_src/source/_themes')
-rw-r--r--user_guide_src/source/_themes/sphinx_rtd_theme/breadcrumbs.html2
-rw-r--r--user_guide_src/source/_themes/sphinx_rtd_theme/static/css/citheme.css18
-rw-r--r--user_guide_src/source/_themes/sphinx_rtd_theme/static/js/theme.js32
3 files changed, 43 insertions, 9 deletions
diff --git a/user_guide_src/source/_themes/sphinx_rtd_theme/breadcrumbs.html b/user_guide_src/source/_themes/sphinx_rtd_theme/breadcrumbs.html
index 1694a1b09..60343661a 100644
--- a/user_guide_src/source/_themes/sphinx_rtd_theme/breadcrumbs.html
+++ b/user_guide_src/source/_themes/sphinx_rtd_theme/breadcrumbs.html
@@ -15,7 +15,7 @@
{% endif %}
</li>
<div style="float:right;margin-left:5px;" id="closeMe">
- <img title="Switch Layout" alt="switch layout" src="data:image/gif;base64,R0lGODlhFAAUAJEAAAAAADMzM////wAAACH5BAUUAAIALAAAAAAUABQAAAImlI+py+0PU5gRBRDM3DxbWoXis42X13USOLauUIqnlsaH/eY6UwAAOw==" />
+ <img title="Classic Layout" alt="classic layout" src="data:image/gif;base64,R0lGODlhFAAUAJEAAAAAADMzM////wAAACH5BAUUAAIALAAAAAAUABQAAAImlI+py+0PU5gRBRDM3DxbWoXis42X13USOLauUIqnlsaH/eY6UwAAOw==" />
</div>
</ul>
<hr/>
diff --git a/user_guide_src/source/_themes/sphinx_rtd_theme/static/css/citheme.css b/user_guide_src/source/_themes/sphinx_rtd_theme/static/css/citheme.css
index 4c5c2f30b..a2a3b3e91 100644
--- a/user_guide_src/source/_themes/sphinx_rtd_theme/static/css/citheme.css
+++ b/user_guide_src/source/_themes/sphinx_rtd_theme/static/css/citheme.css
@@ -72,9 +72,17 @@ div#pulldown-menu {
color: #aaaaaa;
}
-/*disable switch layout on mobile devices*/
-@media (max-width: 768px) {
- #closeMe {
- display: none;
- }
+/*hide pulldown menu on mobile devices*/
+@media (max-width: 768px) { /*tablet size defined by theme*/
+ #closeMe {
+ display: none;
+ }
+
+ #pulldown {
+ display: none;
+ }
+
+ #openToc {
+ display: none;
+ }
} \ No newline at end of file
diff --git a/user_guide_src/source/_themes/sphinx_rtd_theme/static/js/theme.js b/user_guide_src/source/_themes/sphinx_rtd_theme/static/js/theme.js
index b77789d06..52580a056 100644
--- a/user_guide_src/source/_themes/sphinx_rtd_theme/static/js/theme.js
+++ b/user_guide_src/source/_themes/sphinx_rtd_theme/static/js/theme.js
@@ -25,7 +25,7 @@ $(document).ready(function () {
$('#closeMe').toggle(
function ()
{
- setCookie('ciNav', true, 365);
+ setCookie('ciNav', 'true', 365);
$('#nav2').show();
$('#topMenu').remove();
$('body').css({background: 'none'});
@@ -35,7 +35,7 @@ $(document).ready(function () {
},
function ()
{
- setCookie('ciNav', false, 365);
+ setCookie('ciNav', 'false', 365);
$('#topMenu').remove();
$('#nav').hide();
$('#nav2').hide();
@@ -50,14 +50,19 @@ $(document).ready(function () {
//$('#nav').slideToggle();
}
// END MODIFICATION ---
+
});
// Rufnex Cookie functions
function setCookie(cname, cvalue, exdays) {
+ // expire the old cookie if existed to avoid multiple cookies with the same name
+ if (getCookie(cname) != false) {
+ document.cookie = cname + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT";
+ }
var d = new Date();
d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
var expires = "expires=" + d.toGMTString();
- document.cookie = cname + "=" + cvalue + "; " + expires;
+ document.cookie = cname + "=" + cvalue + "; " + expires + "; path=/";
}
function getCookie(cname) {
var name = cname + "=";
@@ -74,6 +79,27 @@ function getCookie(cname) {
}
// End
+// resize window
+$(window).on('resize', function(){
+ // show side nav on small screens when pulldown is enabled
+ if (getCookie('ciNav') == 'true' && $(window).width() <= 768) { // 768px is the tablet size defined by the theme
+ $('.wy-nav-side').show();
+ }
+ // changing css with jQuenry seems to override the default css media query
+ // change margin
+ else if (getCookie('ciNav') == 'false' && $(window).width() <= 768) {
+ $('.wy-nav-content-wrap').css({'margin-left': 0});
+ }
+ // hide side nav on large screens when pulldown is enabled
+ else if (getCookie('ciNav') == 'true' && $(window).width() > 768) {
+ $('.wy-nav-side').hide();
+ }
+ // change margin
+ else if (getCookie('ciNav') == 'false' && $(window).width() > 768) {
+ $('.wy-nav-content-wrap').css({'margin-left': '300px'});
+ }
+});
+
window.SphinxRtdTheme = (function (jquery) {
var stickyNav = (function () {
var navBar,