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

Function jqLiteOff

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

Source from the content-addressed store, hash-verified

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

Callers 1

angular.jsFile · 0.70

Calls 5

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

Tested by

no test coverage detected