From 9419e3972e114c238070ec989fb8229e89d5b407 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sat, 21 Jan 2012 14:58:32 +0000 Subject: [PATCH] better width/height for textarea editables --- source/Ox.UI/js/Form/Ox.Editable.js | 7 ++++++- source/Ox.UI/js/Video/Ox.AnnotationFolder.js | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/source/Ox.UI/js/Form/Ox.Editable.js b/source/Ox.UI/js/Form/Ox.Editable.js index 9e0ceb52..6b64c19e 100644 --- a/source/Ox.UI/js/Form/Ox.Editable.js +++ b/source/Ox.UI/js/Form/Ox.Editable.js @@ -192,7 +192,12 @@ Ox.Editable = function(options, self) { var height, width; self.$test.css({display: 'inline-block'}); height = self.options.height || Ox.limit(self.$test.height(), self.minHeight, self.maxHeight); - width = self.options.width || Ox.limit(self.$test.width(), self.minWidth, self.maxWidth); + width = self.$test.width(); + //+Ox.UI.SCROLLBAR_SIZE to prevent scrollbar from showing up + if (self.options.type == 'textarea') { + width += Ox.UI.SCROLLBAR_SIZE; + } + width = self.options.width || Ox.limit(width, self.minWidth, self.maxWidth); self.$test.css({display: 'none'}); self.$input.options({ width: width, diff --git a/source/Ox.UI/js/Video/Ox.AnnotationFolder.js b/source/Ox.UI/js/Video/Ox.AnnotationFolder.js index 71850c3c..dd287011 100644 --- a/source/Ox.UI/js/Video/Ox.AnnotationFolder.js +++ b/source/Ox.UI/js/Video/Ox.AnnotationFolder.js @@ -212,6 +212,7 @@ Ox.AnnotationFolder = function(options, self) { sort: self.sort, submitOnBlur: false, width: self.options.width, + maxHeight: self.options.type == 'text' ? Infinity : void 0, type: self.options.type == 'text' ? 'textarea' : 'input' }) //.css({marginTop: '256px'})