From 233ce1b37fb3d37b5782e90e438625b0d755501d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Sun, 10 May 2020 17:02:12 +0200 Subject: [PATCH] Switch to reveal 3.7.0 key binding API --- pdfexport.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/pdfexport.js b/pdfexport.js index 18e4d4e..c288511 100644 --- a/pdfexport.js +++ b/pdfexport.js @@ -52,16 +52,11 @@ var PdfExport = ( function( Reveal ){ function installKeyBindings(){ var config = Reveal.getConfig(); var shortcut = config.pdfExportShortcut || 'E'; - if( !config.keyboard ){ - return; - } - var keyboard = config.keyboard === true ? {} : config.keyboard; - keyboard[ shortcut.toUpperCase().charCodeAt( 0 ) ] = togglePdfExport; - - Reveal.registerKeyboardShortcut( shortcut, 'PDF export mode' ); - Reveal.configure({ - keyboard: keyboard - }); + Reveal.addKeyBinding({ + keyCode: shortcut.toUpperCase().charCodeAt( 0 ), + key: shortcut, + description: 'PDF export mode' + }, togglePdfExport ); } function install(){