public/javascripts/yui/treeview/treeview.js
function (ev) {
        var self = this,
            td = this._getEventTargetTdEl(ev),
            node,
            target,
            toggle = function (force) {
                node.focus();
				if (force || !node.href) {
					node.toggle();
					try {
						Event.preventDefault(ev);
					} catch (e) {
	                    // @TODO
	                    // For some reason IE8 is providing an event object with
	                    // most of the fields missing, but only when clicking on
	                    // the node's label, and only when working with inline
	                    // editing.  This generates a "Member not found" error
	                    // in that browser.  Determine if this is a browser
	                    // bug, or a problem with this code.  Already checked to
	                    // see if the problem has to do with access the event
	                    // in the outer scope, and that isn't the problem.
	                    // Maybe the markup for inline editing is broken.
					}
                }
            };

        if (!td) {
            return; 
        }

        node = this.getNodeByElement(td);
        if (!node) { 
            return; 
        }
        
        // exception to handle deprecated event labelClick
        // @TODO take another look at this deprecation.  It is common for people to
        // only be interested in the label click, so why make them have to test
        // the node type to figure out whether the click was on the label?
        target = Event.getTarget(ev);
        if (Dom.hasClass(target, node.labelStyle) || Dom.getAncestorByClassName(target,node.labelStyle)) {
            this.fireEvent('labelClick',node);
        }
        
        //  If it is a toggle cell, toggle
        if (/\bygtv[tl][mp]h?h?/.test(td.className)) {
            toggle(true);
        } else {
            if (this._dblClickTimer) {
                window.clearTimeout(this._dblClickTimer);
                this._dblClickTimer = null;
            } else {
                if (this._hasDblClickSubscriber) {
                    this._dblClickTimer = window.setTimeout(function () {
                        self._dblClickTimer = null;
                        if (self.fireEvent('clickEvent', {event:ev,node:node}) !== false) { 
                            toggle();
                        }
                    }, 200);
                } else {
                    if (self.fireEvent('clickEvent', {event:ev,node:node}) !== false) { 
                        toggle();
                    }
                }
            }
        }
    }
function (ev) {
        var self = this,
            td = this._getEventTargetTdEl(ev),
            node,
            target,
            toggle = function (force) {
                node.focus();
				if (force || !node.href) {
					node.toggle();
					try {
						Event.preventDefault(ev);
					} catch (e) {
	                    // @TODO
	                    // For some reason IE8 is providing an event object with
	                    // most of the fields missing, but only when clicking on
	                    // the node's label, and only when working with inline
	                    // editing.  This generates a "Member not found" error
	                    // in that browser.  Determine if this is a browser
	                    // bug, or a problem with this code.  Already checked to
	                    // see if the problem has to do with access the event
	                    // in the outer scope, and that isn't the problem.
	                    // Maybe the markup for inline editing is broken.
					}
                }
            };

        if (!td) {
            return; 
        }

        node = this.getNodeByElement(td);
        if (!node) { 
            return; 
        }
        
        // exception to handle deprecated event labelClick
        // @TODO take another look at this deprecation.  It is common for people to
        // only be interested in the label click, so why make them have to test
        // the node type to figure out whether the click was on the label?
        target = Event.getTarget(ev);
        if (Dom.hasClass(target, node.labelStyle) || Dom.getAncestorByClassName(target,node.labelStyle)) {
            this.fireEvent('labelClick',node);
        }
        
        //  If it is a toggle cell, toggle
        if (/\bygtv[tl][mp]h?h?/.test(td.className)) {
            toggle(true);
        } else {
            if (this._dblClickTimer) {
                window.clearTimeout(this._dblClickTimer);
                this._dblClickTimer = null;
            } else {
                if (this._hasDblClickSubscriber) {
                    this._dblClickTimer = window.setTimeout(function () {
                        self._dblClickTimer = null;
                        if (self.fireEvent('clickEvent', {event:ev,node:node}) !== false) { 
                            toggle();
                        }
                    }, 200);
                } else {
                    if (self.fireEvent('clickEvent', {event:ev,node:node}) !== false) { 
                        toggle();
                    }
                }
            }
        }
    }
function ( ev ) { var self = this , td = this . _getEventTargetTdEl ( ev ) , node , target , toggle = function ( force ) { node . focus ( ) ; if ( force || ! node . href ) { node . toggle ( ) ; try { Event . preventDefault ( ev ) ; } catch ( e ) { // @TODO // For some reason IE8 is providing an event object with // most of the fields missing, but only when clicking on // the node's label, and only when working with inline // editing.  This generates a "Member not found" error // in that browser.  Determine if this is a browser // bug, or a problem with this code.  Already checked to // see if the problem has to do with access the event // in the outer scope, and that isn't the problem. // Maybe the markup for inline editing is broken. } } } ; if ( ! td ) { return ; } node = this . getNodeByElement ( td ) ; if ( ! node ) { return ; } // exception to handle deprecated event labelClick // @TODO take another look at this deprecation.  It is common for people to // only be interested in the label click, so why make them have to test // the node type to figure out whether the click was on the label? target = Event . getTarget ( ev ) ; if ( Dom . hasClass ( target , node . labelStyle ) || Dom . getAncestorByClassName ( target , node . labelStyle ) ) { this . fireEvent ( 'labelClick' , node ) ; } //  If it is a toggle cell, toggle if ( / \bygtv[tl][mp]h?h? / . test ( td . className ) ) { toggle ( true ) ; } else { if ( this . _dblClickTimer ) { window . clearTimeout ( this . _dblClickTimer ) ; this . _dblClickTimer = null ; } else { if ( this . _hasDblClickSubscriber ) { this . _dblClickTimer = window . setTimeout ( function ( ) { self . _dblClickTimer = null ; if ( self . fireEvent ( 'clickEvent' , { event : ev , node : node } ) !== false ) { toggle ( ) ; } } , 200 ) ; } else { if ( self . fireEvent ( 'clickEvent' , { event : ev , node : node } ) !== false ) { toggle ( ) ; } } } } }
Event listener for click events
@method _onClickEvent
@private
Event listener for click events