From e947f0f21694fefbdd38cd1a79a572041e17f870 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Tue, 26 Nov 2013 09:00:04 -0500 Subject: [PATCH] add zoomKey option for #700 --- plugin/zoom-js/zoom.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugin/zoom-js/zoom.js b/plugin/zoom-js/zoom.js index b67ae16..cd5b06f 100644 --- a/plugin/zoom-js/zoom.js +++ b/plugin/zoom-js/zoom.js @@ -3,7 +3,9 @@ var isEnabled = true; document.querySelector( '.reveal' ).addEventListener( 'mousedown', function( event ) { - if( event.altKey && isEnabled ) { + var modifier = ( Reveal.getConfig().zoomKey ? Reveal.getConfig().zoomKey : 'alt' ) + 'Key'; + + if( event[ modifier ] && isEnabled ) { event.preventDefault(); zoom.to({ element: event.target, pan: false }); } -- 2.26.2