diff options
| author | Vojta Jina | 2011-07-20 01:32:29 +0200 |
|---|---|---|
| committer | Vojta Jina | 2011-09-08 20:37:28 +0200 |
| commit | f37f0ea16edd4b487ef8812ff69a78d9a287fa60 (patch) | |
| tree | b7c2dec7da132551a87bcc70fe4828e4c198690e /test/jqLiteSpec.js | |
| parent | 91ccb4ba6e203f1b80a1aa7187d8773434948fc2 (diff) | |
| download | angular.js-f37f0ea16edd4b487ef8812ff69a78d9a287fa60.tar.bz2 | |
feat(jqLite): add event.isDefaultPrevented() as jQuery
Chrome's Event has defaultPrevented property, but other browsers haven't.
This is workaround for other browsers - same as jQuery.
Diffstat (limited to 'test/jqLiteSpec.js')
| -rw-r--r-- | test/jqLiteSpec.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/jqLiteSpec.js b/test/jqLiteSpec.js index 673bee78..aac5aeb5 100644 --- a/test/jqLiteSpec.js +++ b/test/jqLiteSpec.js @@ -443,6 +443,18 @@ describe('jqLite', function(){ browserTrigger(a, 'click'); }); + + it('should have event.isDefaultPrevented method', function() { + jqLite(a).bind('click', function(e) { + expect(function() { + expect(e.isDefaultPrevented()).toBe(false); + e.preventDefault(); + expect(e.isDefaultPrevented()).toBe(true); + }).not.toThrow(); + }); + + browserTrigger(a, 'click'); + }); }); |
