diff options
author | Alejandro El Informático <aeinformatico@gmail.com> | 2013-04-08 16:18:34 +0200 |
---|---|---|
committer | Alejandro El Informático <aeinformatico@gmail.com> | 2013-04-08 16:18:34 +0200 |
commit | 87894e5503a03c600cf9054e228b1d142d48e821 (patch) | |
tree | 18e4967c31362dbbbeaf1a46c657b339f62716bf /plugin/remotes | |
parent | 308987ee31a0774d4dbfb45df8e9b2b8ed397089 (diff) | |
download | perl-software-in-gnu-guix-87894e5503a03c600cf9054e228b1d142d48e821.tar perl-software-in-gnu-guix-87894e5503a03c600cf9054e228b1d142d48e821.tar.gz |
fix prevents loading remote plugin several times when notes are enabled
Diffstat (limited to 'plugin/remotes')
-rw-r--r-- | plugin/remotes/remotes.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/plugin/remotes/remotes.js b/plugin/remotes/remotes.js index a1f10b8..febdf87 100644 --- a/plugin/remotes/remotes.js +++ b/plugin/remotes/remotes.js @@ -13,7 +13,15 @@ return ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch; })(); - if(!hasTouch){ + /** + * Detects if notes are enable and the current page is opened inside an /iframe + * this prevents loading Remotes.io several times + */ + var remotesAndIsNotes = (function(){ + return !(window.RevealNotes && self == top); + })(); + + if(!hasTouch && !remotesAndIsNotes){ head.ready( 'remotes.ne.min.js', function() { new Remotes("preview") .on("swipe-left", function(e){ Reveal.right(); }) |