MCPcopy Create free account
hub / github.com/OpenReservation/OpenReservation / jqLiteOff

Function jqLiteOff

OpenReservation/wwwroot/Scripts/angular.js:2874–2911  ·  view source on GitHub ↗
(element, type, fn, unsupported)

Source from the content-addressed store, hash-verified

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

Callers 1

jqLiteRemoveDataFunction · 0.85

Calls 5

isDefinedFunction · 0.85
jqLiteExpandoStoreFunction · 0.85
removeEventListenerFnFunction · 0.85
forEachFunction · 0.85
removeHandlerFunction · 0.85

Tested by

no test coverage detected