mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-25 22:33:44 +00:00
avoid namespace conflicts between jqLite and window when running in bootstrap mode
This commit is contained in:
parent
67d064820c
commit
da1d50fbe9
1 changed files with 4 additions and 4 deletions
|
|
@ -5,10 +5,10 @@
|
||||||
var jqCache = {},
|
var jqCache = {},
|
||||||
jqName = 'ng-' + new Date().getTime(),
|
jqName = 'ng-' + new Date().getTime(),
|
||||||
jqId = 1,
|
jqId = 1,
|
||||||
addEventListener = (window.document.attachEvent ?
|
addEventListenerFn = (window.document.attachEvent ?
|
||||||
function(element, type, fn) {element.attachEvent('on' + type, fn);} :
|
function(element, type, fn) {element.attachEvent('on' + type, fn);} :
|
||||||
function(element, type, fn) {element.addEventListener(type, fn, false);}),
|
function(element, type, fn) {element.addEventListener(type, fn, false);}),
|
||||||
removeEventListener = (window.document.detachEvent ?
|
removeEventListenerFn = (window.document.detachEvent ?
|
||||||
function(element, type, fn) {element.detachEvent('on' + type, fn); } :
|
function(element, type, fn) {element.detachEvent('on' + type, fn); } :
|
||||||
function(element, type, fn) { element.removeEventListener(type, fn, false); });
|
function(element, type, fn) { element.removeEventListener(type, fn, false); });
|
||||||
|
|
||||||
|
|
@ -19,7 +19,7 @@ function jqClearData(element) {
|
||||||
cache = jqCache[cacheId];
|
cache = jqCache[cacheId];
|
||||||
if (cache) {
|
if (cache) {
|
||||||
foreach(cache.bind || {}, function(fn, type){
|
foreach(cache.bind || {}, function(fn, type){
|
||||||
removeEventListener(element, type, fn);
|
removeEventListenerFn(element, type, fn);
|
||||||
});
|
});
|
||||||
delete jqCache[cacheId];
|
delete jqCache[cacheId];
|
||||||
if (msie)
|
if (msie)
|
||||||
|
|
@ -112,7 +112,7 @@ JQLite.prototype = {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
eventHandler.fns = [];
|
eventHandler.fns = [];
|
||||||
addEventListener(element, type, eventHandler);
|
addEventListenerFn(element, type, eventHandler);
|
||||||
}
|
}
|
||||||
eventHandler.fns.push(fn);
|
eventHandler.fns.push(fn);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue