1
0
Fork 0

simplify point zoom, switch back to alt + click shortcut for os x support #1909

This commit is contained in:
Hakim El Hattab 2017-06-19 09:45:52 +02:00
parent a781b6a22b
commit af6754bfb7
1 changed files with 5 additions and 11 deletions

View File

@ -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; } );
})();
/*!