diff options
| author | Michał Gołębiowski | 2013-06-19 20:52:50 +0100 |
|---|---|---|
| committer | Pete Bacon Darwin | 2013-06-19 20:53:24 +0100 |
| commit | f1b94b4b599ab701bc75b55bbbbb73c5ef329a93 (patch) | |
| tree | 033c39426a25c8ac86dc7dc4efb1b4d05fe05272 /test/ng/locationSpec.js | |
| parent | 0bfa29377d7a77b360ecd3209d56eeb4f68a5043 (diff) | |
| download | angular.js-f1b94b4b599ab701bc75b55bbbbb73c5ef329a93.tar.bz2 | |
feat(jqLite): switch bind/unbind to more recent jQuery on/off
jQuery switched to a completely new event binding implementation as of
1.7.0, centering around on/off methods instead of previous bind/unbind.
This patch makes jqLite match this implementation while still supporting
previous bind/unbind methods.
Diffstat (limited to 'test/ng/locationSpec.js')
| -rw-r--r-- | test/ng/locationSpec.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test/ng/locationSpec.js b/test/ng/locationSpec.js index 9e4b3bd6..2bce3e64 100644 --- a/test/ng/locationSpec.js +++ b/test/ng/locationSpec.js @@ -7,7 +7,7 @@ describe('$location', function() { afterEach(function() { // link rewriting used in html5 mode on legacy browsers binds to document.onClick, so we need // to clean this up after each test. - jqLite(document).unbind('click'); + jqLite(document).off('click'); }); describe('NewUrl', function() { @@ -770,7 +770,7 @@ describe('$location', function() { originalBrowser = $browser.url(); // we have to prevent the default operation, as we need to test absolute links (http://...) // and navigating to these links would kill jstd - $rootElement.bind('click', function(e) { + $rootElement.on('click', function(e) { lastEventPreventDefault = e.isDefaultPrevented(); e.preventDefault(); }); @@ -825,7 +825,7 @@ describe('$location', function() { jqLite(link). attr('href', 'http://host.com/base/foo'). - bind('click', function(e) { e.preventDefault(); }); + on('click', function(e) { e.preventDefault(); }); browserTrigger(link, 'click'); expect($browser.url()).toBe('http://host.com/base/'); } @@ -1116,11 +1116,11 @@ describe('$location', function() { var base, clickHandler; module(function($provide) { $provide.value('$rootElement', { - bind: function(event, handler) { + on: function(event, handler) { expect(event).toEqual('click'); clickHandler = handler; }, - unbind: noop + off: noop }); return function($browser) { $browser.url(base = 'http://server/'); @@ -1146,11 +1146,11 @@ describe('$location', function() { var base, clickHandler; module(function($provide) { $provide.value('$rootElement', { - bind: function(event, handler) { + on: function(event, handler) { expect(event).toEqual('click'); clickHandler = handler; }, - unbind: angular.noop + off: angular.noop }); return function($browser) { $browser.url(base = 'http://server/'); @@ -1180,7 +1180,7 @@ describe('$location', function() { $rootElement.html('<button></button>'); var button = $rootElement.find('button'); - button.bind('click', function() { + button.on('click', function() { button.remove(); }); browserTrigger(button, 'click'); |
