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

Function jqLiteOff

test/angular/1.4/angular.js:2874–2910  ·  view source on GitHub ↗
(element, type, fn, unsupported)

Source from the content-addressed store, hash-verified

2872}
2873
2874function jqLiteOff(element, type, fn, unsupported) {
2875 if (isDefined(unsupported)) throw jqLiteMinErr('offargs', 'jqLite#off() does not support the `selector` argument');
2876
2877 var expandoStore = jqLiteExpandoStore(element);
2878 var events = expandoStore && expandoStore.events;
2879 var handle = expandoStore && expandoStore.handle;
2880
2881 if (!handle) return; //no listeners registered
2882
2883 if (!type) {
2884 for (type in events) {
2885 if (type !== '$destroy') {
2886 removeEventListenerFn(element, type, handle);
2887 }
2888 delete events[type];
2889 }
2890 } else {
2891
2892 var removeHandler = function(type) {
2893 var listenerFns = events[type];
2894 if (isDefined(fn)) {
2895 arrayRemove(listenerFns || [], fn);
2896 }
2897 if (!(isDefined(fn) && listenerFns && listenerFns.length > 0)) {
2898 removeEventListenerFn(element, type, handle);
2899 delete events[type];
2900 }
2901 };
2902
2903 forEach(type.split(' '), function(type) {
2904 removeHandler(type);
2905 if (MOUSE_EVENT_MAP[type]) {
2906 removeHandler(MOUSE_EVENT_MAP[type]);
2907 }
2908 });
2909 }
2910}
2911
2912function jqLiteRemoveData(element, name) {
2913 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