From: Hakim El Hattab Date: Tue, 26 Nov 2013 14:00:04 +0000 (-0500) Subject: add zoomKey option for #700 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e947f0f21694fefbdd38cd1a79a572041e17f870;p=reveal.js.git add zoomKey option for #700 --- 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 }); }