mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-09 23:34:42 +00:00
parent
5c56011742
commit
4f5dfbc362
2 changed files with 14 additions and 3 deletions
|
|
@ -193,8 +193,8 @@ function JQLiteDealoc(element){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function JQLiteOff(element, type, fn) {
|
function JQLiteOff(element, type, fn, selector) {
|
||||||
if ( arguments.length > 4 ) throw jqLiteMinErr('off_args', 'jqLite#off() does not support the `selector` parameter');
|
if (isDefined(selector)) throw jqLiteMinErr('off_args', 'jqLite#off() does not support the `selector` argument');
|
||||||
|
|
||||||
var events = JQLiteExpandoStore(element, 'events'),
|
var events = JQLiteExpandoStore(element, 'events'),
|
||||||
handle = JQLiteExpandoStore(element, 'handle');
|
handle = JQLiteExpandoStore(element, 'handle');
|
||||||
|
|
|
||||||
|
|
@ -901,7 +901,7 @@ describe('jqLite', function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
describe('unbind', function() {
|
describe('off', function() {
|
||||||
it('should do nothing when no listener was registered with bound', function() {
|
it('should do nothing when no listener was registered with bound', function() {
|
||||||
var aElem = jqLite(a);
|
var aElem = jqLite(a);
|
||||||
|
|
||||||
|
|
@ -1051,6 +1051,17 @@ describe('jqLite', function() {
|
||||||
expect(masterSpy).not.toHaveBeenCalled();
|
expect(masterSpy).not.toHaveBeenCalled();
|
||||||
expect(extraSpy).toHaveBeenCalledOnce();
|
expect(extraSpy).toHaveBeenCalledOnce();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Only run this test for jqLite and not normal jQuery
|
||||||
|
if ( _jqLiteMode ) {
|
||||||
|
it('should throw an error if a selector is passed', function () {
|
||||||
|
var aElem = jqLite(a);
|
||||||
|
aElem.on('click', noop);
|
||||||
|
expect(function () {
|
||||||
|
aElem.off('click', noop, '.test');
|
||||||
|
}).toThrowMatching(/\[jqLite:off_args\]/);
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue