From 051840df3cb89e35c19d5f2e19d35daba3c1b908 Mon Sep 17 00:00:00 2001 From: geekplux Date: Thu, 9 Jun 2016 02:04:51 +0800 Subject: [PATCH] add toc button for mobile screen --- styles/readtheorg/js/readtheorg.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/styles/readtheorg/js/readtheorg.js b/styles/readtheorg/js/readtheorg.js index 5597814..41b9a5d 100644 --- a/styles/readtheorg/js/readtheorg.js +++ b/styles/readtheorg/js/readtheorg.js @@ -39,11 +39,16 @@ $( document ).ready(function() { // add sticky table headers $('table').stickyTableHeaders(); + + // set the height of tableOfContents var $postamble = $('#postamble'); var $tableOfContents = $('#table-of-contents'); - // set the height of tableOfContents $tableOfContents.height($tableOfContents.height() - $postamble.outerHeight()); + // add TOC button + var toggleSidebar = $('

Table of Contents

'); + $('#content').prepend(toggleSidebar); + }); window.SphinxRtdTheme = (function (jquery) {