aboutsummaryrefslogtreecommitdiffstats
path: root/_static/doctools.js
diff options
context:
space:
mode:
Diffstat (limited to '_static/doctools.js')
-rw-r--r--_static/doctools.js28
1 files changed, 26 insertions, 2 deletions
diff --git a/_static/doctools.js b/_static/doctools.js
index c7bfe76..8163495 100644
--- a/_static/doctools.js
+++ b/_static/doctools.js
@@ -4,7 +4,7 @@
4 * 4 *
5 * Sphinx JavaScript utilities for all documentation. 5 * Sphinx JavaScript utilities for all documentation.
6 * 6 *
7 * :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS. 7 * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
8 * :license: BSD, see LICENSE for details. 8 * :license: BSD, see LICENSE for details.
9 * 9 *
10 */ 10 */
@@ -124,6 +124,7 @@ var Documentation = {
124 this.fixFirefoxAnchorBug(); 124 this.fixFirefoxAnchorBug();
125 this.highlightSearchWords(); 125 this.highlightSearchWords();
126 this.initIndexTable(); 126 this.initIndexTable();
127
127 }, 128 },
128 129
129 /** 130 /**
@@ -252,6 +253,29 @@ var Documentation = {
252 }); 253 });
253 var url = parts.join('/'); 254 var url = parts.join('/');
254 return path.substring(url.lastIndexOf('/') + 1, path.length - 1); 255 return path.substring(url.lastIndexOf('/') + 1, path.length - 1);
256 },
257
258 initOnKeyListeners: function() {
259 $(document).keyup(function(event) {
260 var activeElementType = document.activeElement.tagName;
261 // don't navigate when in search box or textarea
262 if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') {
263 switch (event.keyCode) {
264 case 37: // left
265 var prevHref = $('link[rel="prev"]').prop('href');
266 if (prevHref) {
267 window.location.href = prevHref;
268 return false;
269 }
270 case 39: // right
271 var nextHref = $('link[rel="next"]').prop('href');
272 if (nextHref) {
273 window.location.href = nextHref;
274 return false;
275 }
276 }
277 }
278 });
255 } 279 }
256}; 280};
257 281
@@ -260,4 +284,4 @@ _ = Documentation.gettext;
260 284
261$(document).ready(function() { 285$(document).ready(function() {
262 Documentation.init(); 286 Documentation.init();
263}); 287}); \ No newline at end of file