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

Function jqLiteOff

lib/test/angular/1.5.0/angular.js:2887–2923  ·  view source on GitHub ↗
(element, type, fn, unsupported)

Source from the content-addressed store, hash-verified

2885}
2886
2887function jqLiteOff(element, type, fn, unsupported) {
2888 if (isDefined(unsupported)) throw jqLiteMinErr('offargs', 'jqLite#off() does not support the `selector` argument');
2889
2890 var expandoStore = jqLiteExpandoStore(element);
2891 var events = expandoStore && expandoStore.events;
2892 var handle = expandoStore && expandoStore.handle;
2893
2894 if (!handle) return; //no listeners registered
2895
2896 if (!type) {
2897 for (type in events) {
2898 if (type !== '$destroy') {
2899 removeEventListenerFn(element, type, handle);
2900 }
2901 delete events[type];
2902 }
2903 } else {
2904
2905 var removeHandler = function(type) {
2906 var listenerFns = events[type];
2907 if (isDefined(fn)) {
2908 arrayRemove(listenerFns || [], fn);
2909 }
2910 if (!(isDefined(fn) && listenerFns && listenerFns.length > 0)) {
2911 removeEventListenerFn(element, type, handle);
2912 delete events[type];
2913 }
2914 };
2915
2916 forEach(type.split(' '), function(type) {
2917 removeHandler(type);
2918 if (MOUSE_EVENT_MAP[type]) {
2919 removeHandler(MOUSE_EVENT_MAP[type]);
2920 }
2921 });
2922 }
2923}
2924
2925function jqLiteRemoveData(element, name) {
2926 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