static/ext/src/dom/Element_style.js
function(className, testFn, scope) {
        var me = this,
            dom = me.dom,
            hasTest = Ext.isFunction(testFn);
            
        me.on("mousedown", function() {
            if (hasTest && testFn.call(scope || me, me) === false) {
                return false;
            }
            Ext.fly(dom, INTERNAL).addCls(className);
            var d = Ext.getDoc(),
                fn = function() {
                    Ext.fly(dom, INTERNAL).removeCls(className);
                    d.removeListener("mouseup", fn);
                };
            d.on("mouseup", fn);
        });
        return me;
    }
function(className, testFn, scope) {
        var me = this,
            dom = me.dom,
            hasTest = Ext.isFunction(testFn);
            
        me.on("mousedown", function() {
            if (hasTest && testFn.call(scope || me, me) === false) {
                return false;
            }
            Ext.fly(dom, INTERNAL).addCls(className);
            var d = Ext.getDoc(),
                fn = function() {
                    Ext.fly(dom, INTERNAL).removeCls(className);
                    d.removeListener("mouseup", fn);
                };
            d.on("mouseup", fn);
        });
        return me;
    }
function ( className , testFn , scope ) { var me = this , dom = me . dom , hasTest = Ext . isFunction ( testFn ) ; me . on ( "mousedown" , function ( ) { if ( hasTest && testFn . call ( scope || me , me ) === false ) { return false ; } Ext . fly ( dom , INTERNAL ) . addCls ( className ) ; var d = Ext . getDoc ( ) , fn = function ( ) { Ext . fly ( dom , INTERNAL ) . removeCls ( className ) ; d . removeListener ( "mouseup" , fn ) ; } ; d . on ( "mouseup" , fn ) ; } ) ; return me ; }
Sets up event handlers to add and remove a css class when the mouse is down and then up on this element (a click effect)
@param {String} className The class to add
@param {Function} [testFn] A test function to execute before adding the class. The passed parameter
will be the Element instance. If this functions returns false, the class will not be added.
@param {Object} [scope] The scope to execute the testFn in.
@return {Ext.dom.Element} this
Sets up event handlers to add and remove a css class when the mouse is down and then up on this element ( a click effect )