diff options
author | Hakim El Hattab <hakim.elhattab@gmail.com> | 2017-06-19 09:45:52 +0200 |
---|---|---|
committer | Hakim El Hattab <hakim.elhattab@gmail.com> | 2017-06-19 09:45:52 +0200 |
commit | af6754bfb73526ab4ce39631f223cf25eaa9e976 (patch) | |
tree | 09250b08a87735b725e1b8d4a50cbae5530791a5 /plugin | |
parent | a781b6a22bbd5a2fb2b7900b216b2054da80b9ca (diff) | |
download | fosdem-2018-presentation-af6754bfb73526ab4ce39631f223cf25eaa9e976.tar fosdem-2018-presentation-af6754bfb73526ab4ce39631f223cf25eaa9e976.tar.gz |
simplify point zoom, switch back to alt + click shortcut for os x support #1909
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/zoom-js/zoom.js | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/plugin/zoom-js/zoom.js b/plugin/zoom-js/zoom.js index 9e8629f..ce9c6e0 100644 --- a/plugin/zoom-js/zoom.js +++ b/plugin/zoom-js/zoom.js @@ -1,26 +1,20 @@ // Custom reveal.js integration (function(){ - var isEnabled = true; - document.querySelector( '.reveal .slides' ).addEventListener( 'mousedown', function( event ) { - var modifier = ( Reveal.getConfig().zoomKey ? Reveal.getConfig().zoomKey : 'ctrl' ) + 'Key'; + var modifier = ( Reveal.getConfig().zoomKey ? Reveal.getConfig().zoomKey : 'alt' ) + 'Key'; var zoomLevel = ( Reveal.getConfig().zoomLevel ? Reveal.getConfig().zoomLevel : 2 ); - if( event[ modifier ] && isEnabled ) { + if( event[ modifier ] && !Reveal.isOverview() ) { event.preventDefault(); zoom.to({ - x: event.clientX - window.innerWidth / (zoomLevel * 2), - y: event.clientY - window.innerHeight / (zoomLevel * 2), - width: window.innerWidth / zoomLevel, - height: window.innerHeight / zoomLevel, + x: event.clientX, + y: event.clientY, + scale: zoomLevel, pan: false }); } } ); - - Reveal.addEventListener( 'overviewshown', function() { isEnabled = false; } ); - Reveal.addEventListener( 'overviewhidden', function() { isEnabled = true; } ); })(); /*! |