Skip to content
This repository has been archived by the owner on Jan 12, 2019. It is now read-only.

Commit

Permalink
added 2s delay adding fingers to DOM so that this .js can be included…
Browse files Browse the repository at this point in the history
… at the top of your file.
  • Loading branch information
JJones780 committed May 26, 2013
1 parent a77e49c commit 7a6f7f0
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions phantom-limb.js
Expand Up @@ -70,10 +70,7 @@
};

// Instantiate the fingers we'll use in the rest of the script.
var fingers = [
new Finger(),
new Finger()
];
var fingers = null;

// Create a synthetic event from a real event and a finger.
function createMouseEvent(eventName, originalEvent, finger) {
Expand Down Expand Up @@ -325,6 +322,12 @@

// On/off switch
function start() {
if( fingers == null){
fingers = [
new Finger(),
new Finger()
];
}
document.addEventListener('mousedown', phantomTouchStart, true);
document.addEventListener('mousemove', phantomTouchMove, true);
document.addEventListener('mouseup', phantomTouchEnd, true);
Expand Down Expand Up @@ -358,5 +361,5 @@
GLOBAL.phantomLimb = phantomLimb;
}

if (config.startOnLoad) start();
if (config.startOnLoad) setTimeout(start,2000);
}(this));

0 comments on commit 7a6f7f0

Please sign in to comment.