Skip to content
Browse files

Don't use uniqueID in PIE.Util.getUID to avoid the check on non-eleme…

…nts. Make getUID for objects only.
  • Loading branch information...
1 parent 887a062 commit 576790bdf8cb634f2187f8f089c0e7f7ee2f0745 Jason Johnston committed Nov 24, 2011
Showing with 5 additions and 4 deletions.
  1. +2 −2 sources/Element.js
  2. +3 −2 sources/Util.js
View
4 sources/Element.js
@@ -452,12 +452,12 @@ PIE.Element = (function() {
}
Element.getInstance = function( el ) {
- var id = PIE.Util.getUID( el );
+ var id = el[ 'uniqueID' ];
return wrappers[ id ] || ( wrappers[ id ] = new Element( el ) );
};
Element.destroy = function( el ) {
- var id = PIE.Util.getUID( el ),
+ var id = el[ 'uniqueID' ],
wrapper = wrappers[ id ];
if( wrapper ) {
wrapper.destroy();
View
5 sources/Util.js
@@ -10,11 +10,12 @@
/**
* Generate and return a unique ID for a given object. The generated ID is stored
- * as a property of the object for future reuse. DOM Elements use the builtin uniqueID property.
+ * as a property of the object for future reuse. For DOM Elements, don't use this
+ * but use the IE-native uniqueID property instead.
* @param {Object} obj
*/
getUID: function( obj ) {
- return obj && obj[ 'uniqueID' ] || obj[ '_pieId' ] || ( obj[ '_pieId' ] = '_' + idNum++ );
+ return obj && obj[ '_pieId' ] || ( obj[ '_pieId' ] = '_' + idNum++ );
},

0 comments on commit 576790b

Please sign in to comment.
Something went wrong with that request. Please try again.