/**
 * Pimcore
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.pimcore.org/license
 *
 * @copyright  Copyright (c) 2009-2013 pimcore GmbH (http://www.pimcore.org)
 * @license    http://www.pimcore.org/license     New BSD License
 */

pimcore.registerNS("pimcore.document.tags.input");
pimcore.document.tags.input = Class.create(pimcore.document.tag, {

    initialize: function(id, name, options, data, inherited) {
        this.id = id;
        this.name = name;
        this.setupWrapper();
        options = this.parseOptions(options);

        if (!data) {
            data = "";
        }
        
        if(!options.width) {
            options.width = Ext.get(id).getWidth()-2;
        }

        options.value = data;
        options.name = id + "_editable";
        this.element = new Ext.form.TextField(options);
        this.element.render(id);

        if(options["autoStyle"] !== false) {
            var styles = Ext.get(id).parent().getStyles("font-size","font-family","font-style","font-weight",
                                "font-stretch","font-variant","color","line-height","text-shadow","text-align",
                                "text-decoration","text-transform","direction","white-space","word-spacing");
            styles["background"] = "none";
            if(!options["height"]) {
                styles["height"] = "auto";
            }
            this.element.getEl().applyStyles(styles);

            // necessary for IE9
            window.setTimeout(function () {
                this.element.getEl().repaint();
            }.bind(this), 300);
        }
    },

    getValue: function () {
        return this.element.getValue();
    },

    getType: function () {
        return "input";
    }
});

@@ -1520,32 +1520,138 @@
 ;%0A            %7D%0A
+            if(styles%5B%22font-size%22%5D == %220px%22) %7B%0A                delete styles%5B%22font-size%22%5D;%0A            %7D%0A%0A
             this

document input tag bugfix