mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-26 11:10:25 +00:00
fix:jqLite: Set event.target on IE<8
IE<8's Event has not target property - it has srcElement property. Fix that to be consistent as jQuery.
This commit is contained in:
parent
10da625ed9
commit
ce80576e0b
2 changed files with 12 additions and 0 deletions
|
|
@ -369,6 +369,9 @@ forEach({
|
|||
event.cancelBubble = true; //ie
|
||||
};
|
||||
}
|
||||
if (!event.target) {
|
||||
event.target = event.srcElement || document;
|
||||
}
|
||||
forEach(eventHandler.fns, function(fn){
|
||||
fn.call(element, event);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -352,6 +352,15 @@ describe('jqLite', function(){
|
|||
expect(callback).toHaveBeenCalled();
|
||||
expect(callback.callCount).toBe(1);
|
||||
});
|
||||
|
||||
it('should set event.target on IE', function() {
|
||||
var elm = jqLite(a);
|
||||
elm.bind('click', function(event) {
|
||||
expect(event.target).toBe(a);
|
||||
});
|
||||
|
||||
browserTrigger(a, 'click');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue