MCPcopy Index your code
hub / github.com/mailru/FileAPI / _off

Function _off

lib/FileAPI.core.js:141–166  ·  view source on GitHub ↗
(el, type, fn)

Source from the content-addressed store, hash-verified

139 * Remove event listener
140 */
141 _off = function (el, type, fn){
142 if( el ){
143 var uid = api.uid(el), events = _elEvents[uid] || {};
144
145 var isFileReader = (FileReader && el) && (el instanceof FileReader);
146 _each(type.split(/\s+/), function (type){
147 if( jQuery && !isFileReader){
148 jQuery.event.remove(el, type, fn);
149 }
150 else {
151 var fns = events[type] || [], i = fns.length;
152
153 while( i-- ){
154 if( fns[i] === fn ){
155 fns.splice(i, 1);
156 break;
157 }
158 }
159
160 if( el.addEventListener ){ el.removeEventListener(type, fn, false); }
161 else if( el.detachEvent ){ el.detachEvent('on'+type, fn); }
162 else { el['on'+type] = null; }
163 }
164 });
165 }
166 },
167
168
169 _one = function(el, type, fn){

Callers 3

_oneFunction · 0.85
FileAPI.core.jsFile · 0.85
_readAsFunction · 0.85

Calls 1

_eachFunction · 0.85

Tested by

no test coverage detected