mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Disable arrow keys when a modifier key is pressed (#7089)
* Disable arrow keys when a modifier key is pressed Closes #7088. * #7088 document key navigation option * add change note for #7088 Co-authored-by: Timotheus Kampik <timotheus.kampik@signavio.com>
This commit is contained in:
parent
4198219bb1
commit
327778ca22
3
CHANGES
3
CHANGES
@ -82,6 +82,9 @@ Bugs fixed
|
|||||||
module members without :impoprted-members: option
|
module members without :impoprted-members: option
|
||||||
* #6889: autodoc: Trailing comma in ``:members::`` option causes cryptic warning
|
* #6889: autodoc: Trailing comma in ``:members::`` option causes cryptic warning
|
||||||
* #7055: linkcheck: redirect is treated as an error
|
* #7055: linkcheck: redirect is treated as an error
|
||||||
|
* #7088: HTML template: If ``navigation_with_keys`` option is activated,
|
||||||
|
modifier keys are ignored, which means the feature can interfere with browser
|
||||||
|
features
|
||||||
* #7090: std domain: Can't assign numfig-numbers for custom container nodes
|
* #7090: std domain: Can't assign numfig-numbers for custom container nodes
|
||||||
|
|
||||||
Testing
|
Testing
|
||||||
|
@ -151,6 +151,10 @@ These themes are:
|
|||||||
dimension string such as '70em' or '50%'. Use 'none' if you don't
|
dimension string such as '70em' or '50%'. Use 'none' if you don't
|
||||||
want a width limit. Defaults may depend on the theme (often 800px).
|
want a width limit. Defaults may depend on the theme (often 800px).
|
||||||
|
|
||||||
|
- **navigation_with_keys** (true or false): Allow navigating to the
|
||||||
|
previous/next page using the keyboard's left and right arrows. Defaults to
|
||||||
|
``False``.
|
||||||
|
|
||||||
**alabaster**
|
**alabaster**
|
||||||
`Alabaster theme`_ is a modified "Kr" Sphinx theme from @kennethreitz
|
`Alabaster theme`_ is a modified "Kr" Sphinx theme from @kennethreitz
|
||||||
(especially as used in his Requests project), which was itself originally
|
(especially as used in his Requests project), which was itself originally
|
||||||
|
@ -283,10 +283,11 @@ var Documentation = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
initOnKeyListeners: function() {
|
initOnKeyListeners: function() {
|
||||||
$(document).keyup(function(event) {
|
$(document).keydown(function(event) {
|
||||||
var activeElementType = document.activeElement.tagName;
|
var activeElementType = document.activeElement.tagName;
|
||||||
// don't navigate when in search box or textarea
|
// don't navigate when in search box or textarea
|
||||||
if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') {
|
if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT'
|
||||||
|
&& !event.altKey && !event.ctrlKey && !event.metaKey && !event.shiftKey) {
|
||||||
switch (event.keyCode) {
|
switch (event.keyCode) {
|
||||||
case 37: // left
|
case 37: // left
|
||||||
var prevHref = $('link[rel="prev"]').prop('href');
|
var prevHref = $('link[rel="prev"]').prop('href');
|
||||||
|
Loading…
Reference in New Issue
Block a user