MCPcopy Create free account
hub / github.com/EricSimons/ionic-course / jqLiteOff

Function jqLiteOff

code/songhop/www/lib/angular/angular.js:2513–2543  ·  view source on GitHub ↗
(element, type, fn, unsupported)

Source from the content-addressed store, hash-verified

2511}
2512
2513function jqLiteOff(element, type, fn, unsupported) {
2514 if (isDefined(unsupported)) throw jqLiteMinErr('offargs', 'jqLite#off() does not support the `selector` argument');
2515
2516 var expandoStore = jqLiteExpandoStore(element);
2517 var events = expandoStore && expandoStore.events;
2518 var handle = expandoStore && expandoStore.handle;
2519
2520 if (!handle) return; //no listeners registered
2521
2522 if (!type) {
2523 for (type in events) {
2524 if (type !== '$destroy') {
2525 removeEventListenerFn(element, type, handle);
2526 }
2527 delete events[type];
2528 }
2529 } else {
2530 forEach(type.split(' '), function(type) {
2531 if (isDefined(fn)) {
2532 var listenerFns = events[type];
2533 arrayRemove(listenerFns || [], fn);
2534 if (listenerFns && listenerFns.length > 0) {
2535 return;
2536 }
2537 }
2538
2539 removeEventListenerFn(element, type, handle);
2540 delete events[type];
2541 });
2542 }
2543}
2544
2545function jqLiteRemoveData(element, name) {
2546 var expandoId = element.ng339;

Callers 1

jqLiteRemoveDataFunction · 0.70

Calls 5

isDefinedFunction · 0.70
jqLiteExpandoStoreFunction · 0.70
removeEventListenerFnFunction · 0.70
forEachFunction · 0.70
arrayRemoveFunction · 0.70

Tested by

no test coverage detected