From: Robert Konigsberg Date: Tue, 17 Jan 2012 01:10:22 +0000 (-0500) Subject: Make text area size configurable in pixels. X-Git-Tag: v1.0.0~320^2~6 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=5d0f52a5f6b196b955e150aed96ce7b6bb73a26d;p=dygraphs.git Make text area size configurable in pixels. --- diff --git a/common/textarea.js b/common/textarea.js index ce45d8a..d0e1c31 100644 --- a/common/textarea.js +++ b/common/textarea.js @@ -38,6 +38,8 @@ function TextArea(parent) { this.ok.textContent = "OK"; this.cancel = TextArea.createChild("button", this.buttons); this.cancel.textContent = "Cancel"; + this.height = 315; + this.width = 445; var textarea = this; this.ok.onclick = function() { @@ -80,10 +82,6 @@ TextArea.prototype.show = function(title, content) { this.title.textContent = title; this.textarea.value = content; - var height = 315; - var width = 445; - - var sums = function(adds, subtracts, field) { var total = 0; for (var idx in adds) { @@ -97,8 +95,8 @@ TextArea.prototype.show = function(title, content) { this.elem.style.display = "block"; this.background.style.display = "block"; - this.elem.style.height = height + "px"; - this.elem.style.width = width + "px"; + this.elem.style.height = this.height + "px"; + this.elem.style.width = this.width + "px"; this.textarea.style.height = (-18 + sums([this.elem], [this.title, this.buttons], "offsetHeight")) + "px"; this.textarea.style.width = (-16 + sums([this.elem], [ ], "offsetWidth")) + "px";