Do not use uniqueID in IE as it's not always unique. Fix #311.

This commit is contained in:
kangax 2012-11-15 12:49:10 +01:00
parent e3700484ea
commit 01982a446c
4 changed files with 7 additions and 17 deletions

9
dist/all.js vendored
View file

@ -3,11 +3,11 @@
var fabric = fabric || { version: "0.9.21" };
if (typeof exports != 'undefined') {
if (typeof exports !== 'undefined') {
exports.fabric = fabric;
}
if (typeof document != 'undefined' && typeof window != 'undefined') {
if (typeof document !== 'undefined' && typeof window !== 'undefined') {
fabric.document = document;
fabric.window = window;
}
@ -2478,11 +2478,6 @@ fabric.util.string = {
return true;
}
var getUniqueId = (function () {
if (typeof fabric.document.documentElement.uniqueID !== 'undefined') {
return function (element) {
return element.uniqueID;
};
}
var uid = 0;
return function (element) {
return element.__uniqueID || (element.__uniqueID = 'uniqueID__' + uid++);

10
dist/all.min.js vendored

File diff suppressed because one or more lines are too long

BIN
dist/all.min.js.gz vendored

Binary file not shown.

View file

@ -12,11 +12,6 @@
return true;
}
var getUniqueId = (function () {
if (typeof fabric.document.documentElement.uniqueID !== 'undefined') {
return function (element) {
return element.uniqueID;
};
}
var uid = 0;
return function (element) {
return element.__uniqueID || (element.__uniqueID = 'uniqueID__' + uid++);