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

Function jqLiteOff

test/angular/1.3/angular.js:2558–2588  ·  view source on GitHub ↗
(element, type, fn, unsupported)

Source from the content-addressed store, hash-verified

2556}
2557
2558function jqLiteOff(element, type, fn, unsupported) {
2559 if (isDefined(unsupported)) throw jqLiteMinErr('offargs', 'jqLite#off() does not support the `selector` argument');
2560
2561 var expandoStore = jqLiteExpandoStore(element);
2562 var events = expandoStore && expandoStore.events;
2563 var handle = expandoStore && expandoStore.handle;
2564
2565 if (!handle) return; //no listeners registered
2566
2567 if (!type) {
2568 for (type in events) {
2569 if (type !== '$destroy') {
2570 removeEventListenerFn(element, type, handle);
2571 }
2572 delete events[type];
2573 }
2574 } else {
2575 forEach(type.split(' '), function(type) {
2576 if (isDefined(fn)) {
2577 var listenerFns = events[type];
2578 arrayRemove(listenerFns || [], fn);
2579 if (listenerFns && listenerFns.length > 0) {
2580 return;
2581 }
2582 }
2583
2584 removeEventListenerFn(element, type, handle);
2585 delete events[type];
2586 });
2587 }
2588}
2589
2590function jqLiteRemoveData(element, name) {
2591 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