handle update of label option

This commit is contained in:
rolux 2014-02-16 07:06:48 +00:00
parent 3232762576
commit 15444fe5a9
4 changed files with 11 additions and 0 deletions

View file

@ -37,6 +37,9 @@ Ox.Checkbox = function(options, self) {
self.$button.options({disabled: disabled}); self.$button.options({disabled: disabled});
self.$title && self.$title.options({disabled: disabled}); self.$title && self.$title.options({disabled: disabled});
}, },
label: function() {
self.$label.options({title: self.options.label});
},
title: function() { title: function() {
self.$title.options({title: self.options.title}); self.$title.options({title: self.options.title});
}, },

View file

@ -122,6 +122,8 @@ Ox.Input = function(options, self) {
} else if (key == 'height') { } else if (key == 'height') {
that.css({height: value + 'px'}); that.css({height: value + 'px'});
self.$input.css({height: value - 6 + 'px'}); self.$input.css({height: value - 6 + 'px'});
} else if (key == 'label') {
self.$label.options({title: value});
} else if (key == 'labelWidth') { } else if (key == 'labelWidth') {
self.$label.options({width: value}); self.$label.options({width: value});
inputWidth = getInputWidth(); inputWidth = getInputWidth();

View file

@ -53,6 +53,9 @@ Ox.Select = function(options, self) {
// fixme: make default selection restorable // fixme: make default selection restorable
.options(options) .options(options)
.update({ .update({
label: function() {
self.$label.options({title: self.options.label});
},
labelWidth: function() { labelWidth: function() {
self.$label.options({width: self.options.labelWidth}); self.$label.options({width: self.options.labelWidth});
self.$title.css({width: getTitleWidth() + 'px'}); self.$title.css({width: getTitleWidth() + 'px'});

View file

@ -76,6 +76,9 @@ Ox.SelectInput = function(options, self) {
width: self.options.width width: self.options.width
}) })
.update({ .update({
label: function() {
self.$select.options({label: self.options.label});
},
value: function() { value: function() {
self.options.value = that.options('value'); self.options.value = that.options('value');
setValue(); setValue();