diff --git a/src/atsphinx/revealjs_rtd/static/atsphinx-revealjs-rtd/rtd.js b/src/atsphinx/revealjs_rtd/static/atsphinx-revealjs-rtd/rtd.js index 6f4a6bc..fd6f02d 100644 --- a/src/atsphinx/revealjs_rtd/static/atsphinx-revealjs-rtd/rtd.js +++ b/src/atsphinx/revealjs_rtd/static/atsphinx-revealjs-rtd/rtd.js @@ -1,6 +1,11 @@ window.RevealRTD = window.RevealRTD || { id: 'rtd', - init() { - return; + init(reveal) { + const deck = reveal; + deck.addKeyBinding({keyCode: 68, key: 'D', description: 'Toggle RTD widget'}, function() { + const flyout = document.querySelector("readthedocs-flyout"); + if (!flyout) return; + flyout.style.display = flayout.style.display ? "" : "none"; + }); } }