Merge pull request #1644 from rajgoel/dev
Turn off preview links locally
This commit is contained in:
commit
dc159f2825
1 changed files with 4 additions and 3 deletions
|
@ -1031,10 +1031,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
|
||||
|
@ -1570,9 +1571,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' ) ) ) {
|
||||
|
|
Loading…
Reference in a new issue