Browse Source

add zoomKey option for #700

Hakim El Hattab 11 years ago
parent
commit
e947f0f216
1 changed files with 3 additions and 1 deletions
  1. 3 1
      plugin/zoom-js/zoom.js

+ 3 - 1
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 });
 		}