MCPcopy Index your code
hub / github.com/angular-ui/ui-router / jqLiteOff

Function jqLiteOff

test/angular/1.5/angular.js:3036–3072  ·  view source on GitHub ↗
(element, type, fn, unsupported)

Source from the content-addressed store, hash-verified

3034}
3035
3036function jqLiteOff(element, type, fn, unsupported) {
3037 if (isDefined(unsupported)) throw jqLiteMinErr('offargs', 'jqLite#off() does not support the `selector` argument');
3038
3039 var expandoStore = jqLiteExpandoStore(element);
3040 var events = expandoStore && expandoStore.events;
3041 var handle = expandoStore && expandoStore.handle;
3042
3043 if (!handle) return; //no listeners registered
3044
3045 if (!type) {
3046 for (type in events) {
3047 if (type !== '$destroy') {
3048 removeEventListenerFn(element, type, handle);
3049 }
3050 delete events[type];
3051 }
3052 } else {
3053
3054 var removeHandler = function(type) {
3055 var listenerFns = events[type];
3056 if (isDefined(fn)) {
3057 arrayRemove(listenerFns || [], fn);
3058 }
3059 if (!(isDefined(fn) && listenerFns && listenerFns.length > 0)) {
3060 removeEventListenerFn(element, type, handle);
3061 delete events[type];
3062 }
3063 };
3064
3065 forEach(type.split(' '), function(type) {
3066 removeHandler(type);
3067 if (MOUSE_EVENT_MAP[type]) {
3068 removeHandler(MOUSE_EVENT_MAP[type]);
3069 }
3070 });
3071 }
3072}
3073
3074function jqLiteRemoveData(element, name) {
3075 var expandoId = element.ng339;

Callers 1

jqLiteRemoveDataFunction · 0.70

Calls 5

isDefinedFunction · 0.70
jqLiteExpandoStoreFunction · 0.70
removeEventListenerFnFunction · 0.70
forEachFunction · 0.70
removeHandlerFunction · 0.70

Tested by

no test coverage detected