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

Commit

Permalink
fix(jqLite): change expando property to a more unique name
Browse files Browse the repository at this point in the history
This was causing issue when element === window
A better strategy can be thought of later on.
  • Loading branch information
rodyhaddad committed Jun 26, 2014
1 parent a4faa5c commit 74e1cc6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/jqLite.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
* @returns {Object} jQuery object.
*/

JQLite.expando = 'ng';
JQLite.expando = 'ng339';

var jqCache = JQLite.cache = {},
jqId = 1,
Expand Down Expand Up @@ -310,7 +310,7 @@ function jqLiteOff(element, type, fn, unsupported) {
}

function jqLiteRemoveData(element, name) {
var expandoId = element.ng,
var expandoId = element.ng339,
expandoStore = jqCache[expandoId];

if (expandoStore) {
Expand All @@ -324,17 +324,17 @@ function jqLiteRemoveData(element, name) {
jqLiteOff(element);
}
delete jqCache[expandoId];
element.ng = undefined; // don't delete DOM expandos. IE and Chrome don't like it
element.ng339 = undefined; // don't delete DOM expandos. IE and Chrome don't like it
}
}

function jqLiteExpandoStore(element, key, value) {
var expandoId = element.ng,
var expandoId = element.ng339,
expandoStore = jqCache[expandoId || -1];

if (isDefined(value)) {
if (!expandoStore) {
element.ng = expandoId = jqNextId();
element.ng339 = expandoId = jqNextId();
expandoStore = jqCache[expandoId] = {};
}
expandoStore[key] = value;
Expand Down

0 comments on commit 74e1cc6

Please sign in to comment.