Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Replaced roots with a simple boolean because only one presentation ca…

…n run at a time anyways
  • Loading branch information...
commit c40d636985014b2cd7c4853e93c84bf9e84f2ed0 1 parent cf1020c
@jeady authored
Showing with 8 additions and 7 deletions.
  1. +8 −7 js/impress.js
View
15 js/impress.js
@@ -18,6 +18,8 @@
var impress = new (function() {
var self = this;
+ self.presenting = false; // Presentation has not yet started. Only a single presentation is allowed at a time.
+
// Takes a property that is still only implemented using vendor-specific styles and applies the correct
// vendor-specific style for the current browser, e.g.
//
@@ -93,16 +95,15 @@ var impress = new (function() {
var ua = navigator.userAgent.toLowerCase();
var impressSupported = (setBrowserSpecificProperty("perspective") != null) && (document.body.classList) && (document.body.dataset) && (ua.search(/(iphone)|(ipod)|(android)/) == - 1);
- var roots = {};
-
this.start = function(rootId) {
+
+ // Only allow a single presentation at a time
+ if (self.presenting)
+ return;
+ self.presenting = true;
+
rootId = rootId || "impress";
- // if already initialized just return the API
- if (roots["impress-root-" + rootId]) {
- return roots["impress-root-" + rootId];
- }
-
// DOM ELEMENTS
var root = byId(rootId);
self.root = root;
Please sign in to comment.
Something went wrong with that request. Please try again.