aboutsummaryrefslogtreecommitdiff
path: root/js/reveal.js
diff options
context:
space:
mode:
authorAsvin Goel <github@telematique.eu>2016-07-21 12:15:07 +0200
committerGitHub <noreply@github.com>2016-07-21 12:15:07 +0200
commita652e0a8ea3ecb904a9be77a266a5e84b8a9ab3a (patch)
treee4debbb37eacb6bf9a976f1df0cb1d14c0e48b1e /js/reveal.js
parentc1d94f1b60ccbd6e827eb26bd6429571e09ad418 (diff)
downloadfosdem-2018-presentation-a652e0a8ea3ecb904a9be77a266a5e84b8a9ab3a.tar
fosdem-2018-presentation-a652e0a8ea3ecb904a9be77a266a5e84b8a9ab3a.tar.gz
Allow switching off preview links
The data-preview-link=false tag can be used to switch off preview links
Diffstat (limited to 'js/reveal.js')
-rw-r--r--js/reveal.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/js/reveal.js b/js/reveal.js
index b975ff4..b8b64cf 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' ) ) ) {