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

zoom.js works on main wrapper element

parent 76eea300
// Custom reveal.js integration // Custom reveal.js integration
(function(){ (function(){
document.querySelector( '.reveal .slides' ).addEventListener( 'mousedown', function( event ) { var revealElement = document.querySelector( '.reveal' );
var defaultModifier = /Linux/.test( window.navigator.platform ) ? 'ctrl' : 'alt'; if( revealElement ) {
var modifier = ( Reveal.getConfig().zoomKey ? Reveal.getConfig().zoomKey : defaultModifier ) + 'Key'; revealElement.addEventListener( 'mousedown', function( event ) {
var zoomLevel = ( Reveal.getConfig().zoomLevel ? Reveal.getConfig().zoomLevel : 2 ); var defaultModifier = /Linux/.test( window.navigator.platform ) ? 'ctrl' : 'alt';
if( event[ modifier ] && !Reveal.isOverview() ) { var modifier = ( Reveal.getConfig().zoomKey ? Reveal.getConfig().zoomKey : defaultModifier ) + 'Key';
event.preventDefault(); var zoomLevel = ( Reveal.getConfig().zoomLevel ? Reveal.getConfig().zoomLevel : 2 );
zoom.to({ if( event[ modifier ] && !Reveal.isOverview() ) {
x: event.clientX, event.preventDefault();
y: event.clientY,
scale: zoomLevel, zoom.to({
pan: false x: event.clientX,
}); y: event.clientY,
} scale: zoomLevel,
} ); pan: false
});
}
} );
}
})(); })();
/*! /*!
......
Markdown is supported
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