From e947f0f21694fefbdd38cd1a79a572041e17f870 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Tue, 26 Nov 2013 09:00:04 -0500 Subject: add zoomKey option for #700 --- plugin/zoom-js/zoom.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'plugin/zoom-js') 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 }); } -- cgit v1.2.3