src/console/simpleyui.js
function(type, fn, el, obj) {

            var args=Y.Array(arguments, 0, true), compat, l, ok, i,
                id, ce;

            if (args[args.length-1] === COMPAT_ARG) {
                compat = true;
                // args.pop();
            }

            if (type && type.detach) {
                return type.detach();
            }

            // The el argument can be a string
            if (typeof el == "string") {

                // el = (compat) ? Y.DOM.byId(el) : Y.all(el);
                if (compat) {
                    el = Y.DOM.byId(el);
                } else {
                    el = Y.Selector.query(el);
                    l = el.length;
                    if (l < 1) {
                        el = null;
                    } else if (l == 1) {
                        el = el[0];
                    }
                }
                // return Event.detach.apply(Event, args);
            } 
            
            if (!el) {
                return false;
            }

            if (el.detach) {
                args.splice(2, 1);
                return el.detach.apply(el, args);
            // The el argument can be an array of elements or element ids.
            } else if (shouldIterate(el)) {
                ok = true;
                for (i=0, l=el.length; i<l; ++i) {
                    args[2] = el[i];
                    ok = ( Y.Event.detach.apply(Y.Event, args) && ok );
                }

                return ok;
            }

            if (!type || !fn || !fn.call) {
                return this.purgeElement(el, false, type);
            }

            id = 'event:' + Y.stamp(el) + type;
            ce = _wrappers[id];

            if (ce) {
                return ce.detach(fn);
            } else {
                return false;
            }

        }
function(type, fn, el, obj) {

            var args=Y.Array(arguments, 0, true), compat, l, ok, i,
                id, ce;

            if (args[args.length-1] === COMPAT_ARG) {
                compat = true;
                // args.pop();
            }

            if (type && type.detach) {
                return type.detach();
            }

            // The el argument can be a string
            if (typeof el == "string") {

                // el = (compat) ? Y.DOM.byId(el) : Y.all(el);
                if (compat) {
                    el = Y.DOM.byId(el);
                } else {
                    el = Y.Selector.query(el);
                    l = el.length;
                    if (l < 1) {
                        el = null;
                    } else if (l == 1) {
                        el = el[0];
                    }
                }
                // return Event.detach.apply(Event, args);
            } 
            
            if (!el) {
                return false;
            }

            if (el.detach) {
                args.splice(2, 1);
                return el.detach.apply(el, args);
            // The el argument can be an array of elements or element ids.
            } else if (shouldIterate(el)) {
                ok = true;
                for (i=0, l=el.length; i<l; ++i) {
                    args[2] = el[i];
                    ok = ( Y.Event.detach.apply(Y.Event, args) && ok );
                }

                return ok;
            }

            if (!type || !fn || !fn.call) {
                return this.purgeElement(el, false, type);
            }

            id = 'event:' + Y.stamp(el) + type;
            ce = _wrappers[id];

            if (ce) {
                return ce.detach(fn);
            } else {
                return false;
            }

        }
function ( type , fn , el , obj ) { var args = Y . Array ( arguments , 0 , true ) , compat , l , ok , i , id , ce ; if ( args [ args . length - 1 ] === COMPAT_ARG ) { compat = true ; // args.pop(); } if ( type && type . detach ) { return type . detach ( ) ; } // The el argument can be a string if ( typeof el == "string" ) { // el = (compat) ? Y.DOM.byId(el) : Y.all(el); if ( compat ) { el = Y . DOM . byId ( el ) ; } else { el = Y . Selector . query ( el ) ; l = el . length ; if ( l < 1 ) { el = null ; } else if ( l == 1 ) { el = el [ 0 ] ; } } // return Event.detach.apply(Event, args); } if ( ! el ) { return false ; } if ( el . detach ) { args . splice ( 2 , 1 ) ; return el . detach . apply ( el , args ) ; // The el argument can be an array of elements or element ids. } else if ( shouldIterate ( el ) ) { ok = true ; for ( i = 0 , l = el . length ; i < l ; ++ i ) { args [ 2 ] = el [ i ] ; ok = ( Y . Event . detach . apply ( Y . Event , args ) && ok ) ; } return ok ; } if ( ! type || ! fn || ! fn . call ) { return this . purgeElement ( el , false , type ) ; } id = 'event:' + Y . stamp ( el ) + type ; ce = _wrappers [ id ] ; if ( ce ) { return ce . detach ( fn ) ; } else { return false ; } }
Removes an event listener.  Supports the signature the event was bound
with, but the preferred way to remove listeners is using the handle
that is returned when using Y.on

@method detach

@param {String} type the type of event to remove.
@param {Function} fn the method the event invokes.  If fn is
undefined, then all event handlers for the type of event are
removed.
@param {String|HTMLElement|Array|NodeList|EventHandle} el An
event handle, an id, an element reference, or a collection
of ids and/or elements to remove the listener from.
@return {boolean} true if the unbind was successful, false otherwise.
@static
Removes an event listener . Supports the signature the event was bound with but the preferred way to remove listeners is using the handle that is returned when using Y . on