diff --git a/core/modules/widgets/edit-text.js b/core/modules/widgets/edit-text.js index c4cb588a5..c0588f93c 100644 --- a/core/modules/widgets/edit-text.js +++ b/core/modules/widgets/edit-text.js @@ -52,6 +52,9 @@ EditTextWidget.prototype.render = function(parent,nextSibling) { if(this.editSize) { domNode.setAttribute("size",this.editSize); } + if(this.editRows) { + domNode.setAttribute("rows",this.editRows); + } // Assign classes if(this.editClass) { domNode.className = this.editClass; @@ -79,7 +82,7 @@ EditTextWidget.prototype.render = function(parent,nextSibling) { if(this.editFocus === "true") { if(domNode.focus && domNode.select) { domNode.focus(); - domNode.select(); + domNode.select(); } } }; @@ -148,6 +151,7 @@ EditTextWidget.prototype.execute = function() { this.editClass = this.getAttribute("class"); this.editPlaceholder = this.getAttribute("placeholder"); this.editSize = this.getAttribute("size"); + this.editRows = this.getAttribute("rows"); this.editAutoHeight = this.getAttribute("autoHeight","yes") === "yes"; this.editMinHeight = this.getAttribute("minHeight",DEFAULT_MIN_TEXT_AREA_HEIGHT); this.editFocusPopup = this.getAttribute("focusPopup"); @@ -178,7 +182,7 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of EditTextWidget.prototype.refresh = function(changedTiddlers) { var changedAttributes = this.computeAttributes(); // Completely rerender if any of our attributes have changed - if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedAttributes["default"] || changedAttributes["class"] || changedAttributes.placeholder || changedAttributes.size || changedAttributes.autoHeight || changedAttributes.minHeight || changedAttributes.focusPopup) { + if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedAttributes["default"] || changedAttributes["class"] || changedAttributes.placeholder || changedAttributes.size || changedAttributes.autoHeight || changedAttributes.minHeight || changedAttributes.focusPopup || changedAttributes.rows) { this.refreshSelf(); return true; } else if(changedTiddlers[this.editTitle]) { diff --git a/editions/tw5.com/tiddlers/widgets/EditTextWidget.tid b/editions/tw5.com/tiddlers/widgets/EditTextWidget.tid index 51042756e..b4e7c3c31 100644 --- a/editions/tw5.com/tiddlers/widgets/EditTextWidget.tid +++ b/editions/tw5.com/tiddlers/widgets/EditTextWidget.tid @@ -1,8 +1,9 @@ -title: EditTextWidget -created: 201310241419 -modified: 20150220162131000 -tags: Widgets caption: edit-text +created: 20131024141900000 +modified: 20151224143914772 +tags: Widgets +title: EditTextWidget +type: text/vnd.tiddlywiki ! Introduction @@ -28,6 +29,7 @@ The content of the `<$edit-text>` widget is ignored. |size |The size of the input field (in characters) | |autoHeight |Either "yes" or "no" to specify whether to automatically resize `textarea` editors to fit their content (defaults to "yes") | |minHeight |Minimum height for automatically resized `textarea` editors, specified in CSS length units such as "px", "em" or "%" | +|rows|Sets the rows attribute of a generated textarea | ! Notes