fix prevents loading remote plugin several times when notes are enabled

This commit is contained in:
Alejandro El Informático 2013-04-08 16:18:34 +02:00
parent 308987ee31
commit 87894e5503
1 changed files with 9 additions and 1 deletions

View File

@ -13,7 +13,15 @@
return ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch; 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() { head.ready( 'remotes.ne.min.js', function() {
new Remotes("preview") new Remotes("preview")
.on("swipe-left", function(e){ Reveal.right(); }) .on("swipe-left", function(e){ Reveal.right(); })