forked from 0x2620/oxjs
self.setOption ~> that.update
This commit is contained in:
parent
9ee0742b53
commit
005d50c389
56 changed files with 919 additions and 933 deletions
|
|
@ -34,6 +34,24 @@ Ox.Checkbox = function(options, self) {
|
|||
width: 'auto'
|
||||
})
|
||||
.options(options || {})
|
||||
.update({
|
||||
disabled: function() {
|
||||
var disabled = self.options.disabled;
|
||||
that.attr({disabled: disabled});
|
||||
self.$button.options({disabled: disabled});
|
||||
self.$title && self.$title.options({disabled: disabled});
|
||||
},
|
||||
title: function() {
|
||||
self.$title.options({title: self.options.title});
|
||||
},
|
||||
value: function() {
|
||||
self.$button.toggle();
|
||||
},
|
||||
width: function() {
|
||||
that.css({width: self.options.width + 'px'});
|
||||
self.$title && self.$title.options({width: getTitleWidth()});
|
||||
}
|
||||
})
|
||||
.addClass('OxCheckbox' + (
|
||||
self.options.overlap == 'none'
|
||||
? '' : ' OxOverlap' + Ox.toTitleCase(self.options.overlap)
|
||||
|
|
@ -98,21 +116,6 @@ Ox.Checkbox = function(options, self) {
|
|||
- !!self.options.label * self.options.labelWidth;
|
||||
}
|
||||
|
||||
self.setOption = function(key, value) {
|
||||
if (key == 'disabled') {
|
||||
that.attr({disabled: value});
|
||||
self.$button.options({disabled: value});
|
||||
self.$title && self.$title.options({disabled: value});
|
||||
} else if (key == 'title') {
|
||||
self.$title.options({title: value});
|
||||
} else if (key == 'value') {
|
||||
self.$button.toggle();
|
||||
} else if (key == 'width') {
|
||||
that.css({width: value + 'px'});
|
||||
self.$title && self.$title.options({width: getTitleWidth()});
|
||||
}
|
||||
};
|
||||
|
||||
return that;
|
||||
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue