Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #2144 from ibolmo/fix-2118-global-uid

Fixes #2118.
  • Loading branch information...
commit 65b1df5334d10c8ea390701538f1840e84b17b36 2 parents 27a2d5d + f726b48
@cpojer cpojer authored
Showing with 11 additions and 19 deletions.
  1. +0 −11 Source/Browser/Browser.js
  2. +11 −8 Source/Element/Element.js
View
11 Source/Browser/Browser.js
@@ -19,17 +19,6 @@ provides: [Browser, Window, Document]
var document = this.document;
var window = document.window = this;
-var UID = 1;
-
-this.$uid = (window.ActiveXObject) ? function(item){
- return (item.uid || (item.uid = [UID++]))[0];
-} : function(item){
- return item.uid || (item.uid = UID++);
-};
-
-$uid(window);
-$uid(document);
-
var ua = navigator.userAgent.toLowerCase(),
platform = navigator.platform.toLowerCase(),
UA = ua.match(/(opera|ie|firefox|chrome|version)[\s\/:]([\w\d\.]+)?.*?(safari|version[\s\/:]([\w\d\.]+)|$)/) || [null, 'unknown', 0],
View
19 Source/Element/Element.js
@@ -231,6 +231,11 @@ Document.implement({
})();
+(function(){
+
+Slick.uidOf(window);
+Slick.uidOf(document);
+
Document.implement({
newTextNode: function(text){
@@ -255,7 +260,7 @@ Document.implement({
},
element: function(el, nocash){
- $uid(el);
+ Slick.uidOf(el);
if (!nocash && !el.$family && !(/^(?:object|embed)$/i).test(el.tagName)){
el._fireEvent = el.fireEvent;
Object.append(el, Element.Prototype);
@@ -275,7 +280,7 @@ Document.implement({
};
return function(el, nocash, doc){
- if (el && el.$family && el.uid) return el;
+ if (el && el.$family && el.uniqueNumber) return el;
var type = typeOf(el);
return (types[type]) ? types[type](el, nocash, doc || document) : null;
};
@@ -446,8 +451,6 @@ if (window.$$ == null) Window.implement('$$', function(selector){
return new Elements(arguments);
});
-(function(){
-
// Inserters
var inserters = {
@@ -812,7 +815,7 @@ Element.implement({
old();
};
} else {
- collected[$uid(this)] = this;
+ collected[Slick.uidOf(this)] = this;
}
if (this.addEventListener) this.addEventListener(type, fn, !!arguments[2]);
else this.attachEvent('on' + type, fn);
@@ -826,19 +829,19 @@ Element.implement({
},
retrieve: function(property, dflt){
- var storage = get($uid(this)), prop = storage[property];
+ var storage = get(Slick.uidOf(this)), prop = storage[property];
if (dflt != null && prop == null) prop = storage[property] = dflt;
return prop != null ? prop : null;
},
store: function(property, value){
- var storage = get($uid(this));
+ var storage = get(Slick.uidOf(this));
storage[property] = value;
return this;
},
eliminate: function(property){
- var storage = get($uid(this));
+ var storage = get(Slick.uidOf(this));
delete storage[property];
return this;
}
Please sign in to comment.
Something went wrong with that request. Please try again.