lib/Ext/dom/Element.style.js
function(names, prefix, suffix) {
        if (!names) {
            return this;
        }

        if (!this.isSynchronized) {
            this.synchronize();
        }

        var dom = this.dom,
            map = this.hasClassMap,
            classList = this.classList,
            SEPARATOR = this.SEPARATOR,
            i, ln, name;

        prefix = prefix ? prefix + SEPARATOR : '';
        suffix = suffix ? SEPARATOR + suffix : '';

        if (typeof names == 'string') {
            names = names.split(this.spacesRe);
        }

        for (i = 0, ln = names.length; i < ln; i++) {
            name = prefix + names[i] + suffix;

            if (!map[name]) {
                map[name] = true;
                classList.push(name);
            }
        }

        dom.className = classList.join(' ');

        return this;
    }
function(names, prefix, suffix) {
        if (!names) {
            return this;
        }

        if (!this.isSynchronized) {
            this.synchronize();
        }

        var dom = this.dom,
            map = this.hasClassMap,
            classList = this.classList,
            SEPARATOR = this.SEPARATOR,
            i, ln, name;

        prefix = prefix ? prefix + SEPARATOR : '';
        suffix = suffix ? SEPARATOR + suffix : '';

        if (typeof names == 'string') {
            names = names.split(this.spacesRe);
        }

        for (i = 0, ln = names.length; i < ln; i++) {
            name = prefix + names[i] + suffix;

            if (!map[name]) {
                map[name] = true;
                classList.push(name);
            }
        }

        dom.className = classList.join(' ');

        return this;
    }
function ( names , prefix , suffix ) { if ( ! names ) { return this ; } if ( ! this . isSynchronized ) { this . synchronize ( ) ; } var dom = this . dom , map = this . hasClassMap , classList = this . classList , SEPARATOR = this . SEPARATOR , i , ln , name ; prefix = prefix ? prefix + SEPARATOR : '' ; suffix = suffix ? SEPARATOR + suffix : '' ; if ( typeof names == 'string' ) { names = names . split ( this . spacesRe ) ; } for ( i = 0 , ln = names . length ; i < ln ; i ++ ) { name = prefix + names [ i ] + suffix ; if ( ! map [ name ] ) { map [ name ] = true ; classList . push ( name ) ; } } dom . className = classList . join ( ' ' ) ; return this ; }
Adds the given CSS class(es) to this Element.
@param {String} names The CSS class(es) to add to this element.
@param {String} [prefix] (optional) Prefix to prepend to each class.
@param {String} [suffix] (optional) Suffix to append to each class.
Adds the given CSS class ( es ) to this Element .