From: Hakim El Hattab Date: Sun, 15 Jan 2012 01:31:41 +0000 (-0800) Subject: don't apply linkify effect to anchors containing images X-Git-Tag: 1.2.0~24 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=510ac8e114be264e66833cc414202ba91e8bf3d3;p=reveal.js.git don't apply linkify effect to anchors containing images --- diff --git a/js/reveal.js b/js/reveal.js index 75d3141..60bd0f4 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -73,6 +73,7 @@ * - Controls and progress bar were moved into #reveal * - All CSS is now much more explicit, rooted at #reveal, to prevent conflicts * - Config option for disabling updates to URL, defaults to true + * - Removed dependency on classList * * * @author Hakim El Hattab | http://hakim.se @@ -306,7 +307,7 @@ var Reveal = (function(){ for( var i = 0, len = nodes.length; i < len; i++ ) { var node = nodes[i]; - if( node.textContent && ( !node.className || !hasClass( node, 'roll' ) ) ) { + if( node.textContent && !node.querySelector( 'img' ) && ( !node.className || !hasClass( node, 'roll' ) ) ) { addClass( node, 'roll' ); node.innerHTML = '' + node.innerHTML + ''; } @@ -617,7 +618,7 @@ var Reveal = (function(){ return false; } - + function hasClass( node, klass ) { return !!node.className.match( klass ); }