From fcff01e3cceaaf0871481bdb9be0956ee6bd0d3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20St=C3=B6ckel?= Date: Fri, 19 Aug 2011 16:39:28 +0000 Subject: [PATCH] Fixed textbox cols/rows always being set to 1 --- etemplate/js/et2_textbox.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/etemplate/js/et2_textbox.js b/etemplate/js/et2_textbox.js index e9fd98bc9a..8e058042fb 100644 --- a/etemplate/js/et2_textbox.js +++ b/etemplate/js/et2_textbox.js @@ -41,13 +41,13 @@ var et2_textbox = et2_inputWidget.extend({ "rows": { "name": "Rows", "type": "integer", - "default": 1, + "default": -1, "description": "Multiline field height - better to use CSS" }, "cols": { "name": "Size", "type": "integer", - "default": 1, + "default": -1, "description": "Multiline field width - better to use CSS" }, }, @@ -63,9 +63,17 @@ var et2_textbox = et2_inputWidget.extend({ createInputWidget: function() { if (this.options.multiline || this.options.rows > 1 || this.options.cols > 1) { - this.input = $j(document.createElement("textarea")) - .attr("rows", this.options.rows) - .attr("cols", this.options.cols); + this.input = $j(document.createElement("textarea")); + + if (this.options.rows > 0) + { + this.input.attr("rows", this.options.rows); + } + + if (this.options.cols > 0) + { + this.input.attr("cols", this.options.cols); + } } else {