lib/Ext/dom/Element.static.js
function(size, units) {
        // Size set to a value which means "auto"
        if (size === "" || size == "auto" || size === undefined || size === null) {
            return size || '';
        }

        // Otherwise, warn if it's not a valid CSS measurement
        if (Ext.isNumber(size) || this.numberRe.test(size)) {
            return size + (units || this.defaultUnit || 'px');
        }
        else if (!this.unitRe.test(size)) {
            //<debug>
            Ext.Logger.warn("Warning, size detected (" + size + ") not a valid property value on Element.addUnits.");
            //</debug>
            return size || '';
        }

        return size;
    }
function(size, units) {
        // Size set to a value which means "auto"
        if (size === "" || size == "auto" || size === undefined || size === null) {
            return size || '';
        }

        // Otherwise, warn if it's not a valid CSS measurement
        if (Ext.isNumber(size) || this.numberRe.test(size)) {
            return size + (units || this.defaultUnit || 'px');
        }
        else if (!this.unitRe.test(size)) {
            //<debug>
            Ext.Logger.warn("Warning, size detected (" + size + ") not a valid property value on Element.addUnits.");
            //</debug>
            return size || '';
        }

        return size;
    }
function ( size , units ) { // Size set to a value which means "auto" if ( size === "" || size == "auto" || size === undefined || size === null ) { return size || '' ; } // Otherwise, warn if it's not a valid CSS measurement if ( Ext . isNumber ( size ) || this . numberRe . test ( size ) ) { return size + ( units || this . defaultUnit || 'px' ) ; } else if ( ! this . unitRe . test ( size ) ) { //<debug> Ext . Logger . warn ( "Warning, size detected (" + size + ") not a valid property value on Element.addUnits." ) ; //</debug> return size || '' ; } return size ; }
Test if size has a unit, otherwise appends the passed unit string, or the default for this Element.
@param {Object} size The size to set.
@param {String} units The units to append to a numeric size value.
@return {String}
@private
@static
Test if size has a unit otherwise appends the passed unit string or the default for this Element .