浏览代码

prevent repeated initialization #1616

Hakim El Hattab 8 年之前
父节点
当前提交
6bfa48a667
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      js/reveal.js

+ 8 - 0
js/reveal.js

@@ -165,6 +165,9 @@
 
 		},
 
+		// Flags if Reveal.initialize() has been called
+		initialized = false,
+
 		// Flags if reveal.js is loaded (has dispatched the 'ready' event)
 		loaded = false,
 
@@ -257,6 +260,11 @@
 	 */
 	function initialize( options ) {
 
+		// Make sure we only initialize once
+		if( initialized === true ) return;
+
+		initialized = true;
+
 		checkCapabilities();
 
 		if( !features.transforms2d && !features.transforms3d ) {