better width/height for textarea editables

This commit is contained in:
j 2012-01-21 14:58:32 +00:00
parent 1b42a4e7f1
commit 9419e3972e
2 changed files with 7 additions and 1 deletions

View file

@ -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,

View file

@ -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'})