Commit af6754bf authored by Hakim El Hattab's avatar Hakim El Hattab
Browse files

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

parent a781b6a2
// Custom reveal.js integration // Custom reveal.js integration
(function(){ (function(){
var isEnabled = true;
document.querySelector( '.reveal .slides' ).addEventListener( 'mousedown', function( event ) { 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 ); var zoomLevel = ( Reveal.getConfig().zoomLevel ? Reveal.getConfig().zoomLevel : 2 );
if( event[ modifier ] && isEnabled ) { if( event[ modifier ] && !Reveal.isOverview() ) {
event.preventDefault(); event.preventDefault();
zoom.to({ zoom.to({
x: event.clientX - window.innerWidth / (zoomLevel * 2), x: event.clientX,
y: event.clientY - window.innerHeight / (zoomLevel * 2), y: event.clientY,
width: window.innerWidth / zoomLevel, scale: zoomLevel,
height: window.innerHeight / zoomLevel,
pan: false pan: false
}); });
} }
} ); } );
Reveal.addEventListener( 'overviewshown', function() { isEnabled = false; } );
Reveal.addEventListener( 'overviewhidden', function() { isEnabled = true; } );
})(); })();
/*! /*!
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment