Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion lib/metamorph.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@

var K = function(){},
guid = 0,
// At initialization, create a prefix associated with this Metamorph instance.
// This is useful if you have multiple metamorphs in a page, which happens if you
// have a Chrome extension with a content script written in Ember, and navigate to
// a page written in Ember.
ts = (new Date()).valueOf().toString();
rand = ((Math.random() * 0x10000)|0).toString();
prefix = ts + rand;

document = window.document,

// Feature-detect the W3C range API, the extended check is for IE9 which only partially supports ranges
Expand Down Expand Up @@ -37,7 +45,7 @@
}

self.innerHTML = html;
var myGuid = 'metamorph-'+(guid++);
var myGuid = 'metamorph-' + prefix + '-' + (guid++);
self.start = myGuid + '-start';
self.end = myGuid + '-end';

Expand Down