MCPcopy
hub / github.com/angular-ui/ui-grid / jqLiteOff

Function jqLiteOff

lib/test/angular/1.8.0/angular.js:3365–3403  ·  view source on GitHub ↗
(element, type, fn, unsupported)

Source from the content-addressed store, hash-verified

3363}
3364
3365function jqLiteOff(element, type, fn, unsupported) {
3366 if (isDefined(unsupported)) throw jqLiteMinErr('offargs', 'jqLite#off() does not support the `selector` argument');
3367
3368 var expandoStore = jqLiteExpandoStore(element);
3369 var events = expandoStore && expandoStore.events;
3370 var handle = expandoStore && expandoStore.handle;
3371
3372 if (!handle) return; //no listeners registered
3373
3374 if (!type) {
3375 for (type in events) {
3376 if (type !== '$destroy') {
3377 element.removeEventListener(type, handle);
3378 }
3379 delete events[type];
3380 }
3381 } else {
3382
3383 var removeHandler = function(type) {
3384 var listenerFns = events[type];
3385 if (isDefined(fn)) {
3386 arrayRemove(listenerFns || [], fn);
3387 }
3388 if (!(isDefined(fn) && listenerFns && listenerFns.length > 0)) {
3389 element.removeEventListener(type, handle);
3390 delete events[type];
3391 }
3392 };
3393
3394 forEach(type.split(' '), function(type) {
3395 removeHandler(type);
3396 if (MOUSE_EVENT_MAP[type]) {
3397 removeHandler(MOUSE_EVENT_MAP[type]);
3398 }
3399 });
3400 }
3401
3402 removeIfEmptyData(element);
3403}
3404
3405function jqLiteRemoveData(element, name) {
3406 var expandoId = element.ng339;

Callers 1

angular.jsFile · 0.70

Calls 5

isDefinedFunction · 0.70
jqLiteExpandoStoreFunction · 0.70
forEachFunction · 0.70
removeHandlerFunction · 0.70
removeIfEmptyDataFunction · 0.70

Tested by

no test coverage detected