From df47a3c8c00e78c34ffbcfe9143fa87ef074d287 Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 24 Apr 2009 19:44:53 +0000 Subject: [PATCH] can't get dijit textarea to honor spaces/tabs. this custom textarea widget (much simpler) works nicely git-svn-id: svn://svn.open-ils.org/ILS/trunk@12981 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/js/dojo/openils/widget/Textarea.js | 41 +++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 Open-ILS/web/js/dojo/openils/widget/Textarea.js diff --git a/Open-ILS/web/js/dojo/openils/widget/Textarea.js b/Open-ILS/web/js/dojo/openils/widget/Textarea.js new file mode 100644 index 0000000000..2af9f6fef4 --- /dev/null +++ b/Open-ILS/web/js/dojo/openils/widget/Textarea.js @@ -0,0 +1,41 @@ +if(!dojo._hasResource['openils.widget.Textarea']) { + dojo.provide('openils.widget.Textarea'); + dojo.require("dijit.form._FormWidget"); + + /** + * Simple textarea that honors spaces/tabs + */ + + dojo.declare( + 'openils.widget.Textarea', dijit.form._FormValueWidget, + { + width : '', + height : '', + templateString : '', + + constructor : function(args) { + if(!args) args = {}; + this.width = args.width || openils.widget.Textarea.width; + this.height = args.height || openils.widget.Textarea.height; + }, + + postCreate : function() { + if(this.width) + dojo.style(this.domNode, 'width', this.width); + if(this.height) + dojo.style(this.domNode, 'height', this.height); + }, + + attr : function(name, val) { + if(name == 'value') { + if(val) + this.domNode.value = val; + return this.domNode.value; + } else { + return this.inherited(arguments); + } + } + } + ); +} + -- 2.11.0