Quellcode durchsuchen

Merge branch 'master' of https://github.com/ainformatico/reveal.js into dev

Hakim El Hattab vor 12 Jahren
Ursprung
Commit
5181f6e17f
1 geänderte Dateien mit 9 neuen und 1 gelöschten Zeilen
  1. 9 1
      plugin/remotes/remotes.js

+ 9 - 1
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(); })