From a652e0a8ea3ecb904a9be77a266a5e84b8a9ab3a Mon Sep 17 00:00:00 2001 From: Asvin Goel Date: Thu, 21 Jul 2016 12:15:07 +0200 Subject: [PATCH] Allow switching off preview links The data-preview-link=false tag can be used to switch off preview links --- js/reveal.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/js/reveal.js b/js/reveal.js index b975ff43..b8b64cf2 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -983,10 +983,11 @@ // Iframe link previews if( config.previewLinks ) { enablePreviewLinks(); + disablePreviewLinks( '[data-preview-link=false]' ); } else { disablePreviewLinks(); - enablePreviewLinks( '[data-preview-link]' ); + enablePreviewLinks( '[data-preview-link]:not([data-preview-link=false])' ); } // Remove existing auto-slide controls @@ -1456,9 +1457,9 @@ /** * Unbind preview frame links. */ - function disablePreviewLinks() { + function disablePreviewLinks( selector ) { - var anchors = toArray( document.querySelectorAll( 'a' ) ); + var anchors = toArray( document.querySelectorAll( selector ? selector : 'a' ) ); anchors.forEach( function( element ) { if( /^(http|www)/gi.test( element.getAttribute( 'href' ) ) ) {