zoom.js uses ctrl+click for linux, alt+click for others #1909

edit
Hakim El Hattab 2017-06-19 09:52:56 +02:00
parent af6754bfb7
commit 76eea30083
1 changed files with 3 additions and 1 deletions

View File

@ -1,7 +1,9 @@
// Custom reveal.js integration // Custom reveal.js integration
(function(){ (function(){
document.querySelector( '.reveal .slides' ).addEventListener( 'mousedown', function( event ) { document.querySelector( '.reveal .slides' ).addEventListener( 'mousedown', function( event ) {
var modifier = ( Reveal.getConfig().zoomKey ? Reveal.getConfig().zoomKey : 'alt' ) + 'Key'; var defaultModifier = /Linux/.test( window.navigator.platform ) ? 'ctrl' : 'alt';
var modifier = ( Reveal.getConfig().zoomKey ? Reveal.getConfig().zoomKey : defaultModifier ) + 'Key';
var zoomLevel = ( Reveal.getConfig().zoomLevel ? Reveal.getConfig().zoomLevel : 2 ); var zoomLevel = ( Reveal.getConfig().zoomLevel ? Reveal.getConfig().zoomLevel : 2 );
if( event[ modifier ] && !Reveal.isOverview() ) { if( event[ modifier ] && !Reveal.isOverview() ) {