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

Function jqLiteOff

lib/test/angular/1.6.7/angular.js:3256–3292  ·  view source on GitHub ↗
(element, type, fn, unsupported)

Source from the content-addressed store, hash-verified

3254}
3255
3256function jqLiteOff(element, type, fn, unsupported) {
3257 if (isDefined(unsupported)) throw jqLiteMinErr('offargs', 'jqLite#off() does not support the `selector` argument');
3258
3259 var expandoStore = jqLiteExpandoStore(element);
3260 var events = expandoStore && expandoStore.events;
3261 var handle = expandoStore && expandoStore.handle;
3262
3263 if (!handle) return; //no listeners registered
3264
3265 if (!type) {
3266 for (type in events) {
3267 if (type !== '$destroy') {
3268 element.removeEventListener(type, handle);
3269 }
3270 delete events[type];
3271 }
3272 } else {
3273
3274 var removeHandler = function(type) {
3275 var listenerFns = events[type];
3276 if (isDefined(fn)) {
3277 arrayRemove(listenerFns || [], fn);
3278 }
3279 if (!(isDefined(fn) && listenerFns && listenerFns.length > 0)) {
3280 element.removeEventListener(type, handle);
3281 delete events[type];
3282 }
3283 };
3284
3285 forEach(type.split(' '), function(type) {
3286 removeHandler(type);
3287 if (MOUSE_EVENT_MAP[type]) {
3288 removeHandler(MOUSE_EVENT_MAP[type]);
3289 }
3290 });
3291 }
3292}
3293
3294function jqLiteRemoveData(element, name) {
3295 var expandoId = element.ng339;

Callers 1

jqLiteRemoveDataFunction · 0.70

Calls 4

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

Tested by

no test coverage detected