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,19 @@ Ox.MenuButton = function(options, self) {
|
|||
width: 'auto'
|
||||
})
|
||||
.options(options || {})
|
||||
.update({
|
||||
title: function() {
|
||||
if (self.options.type == 'text') {
|
||||
self.$title.html(self.options.title);
|
||||
} else {
|
||||
self.$button.options({title: self.options.title});
|
||||
}
|
||||
},
|
||||
width: function() {
|
||||
that.css({width: self.options.width - 2 + 'px'});
|
||||
self.$title.css({width: self.options.width - 24 + 'px'});
|
||||
}
|
||||
})
|
||||
.addClass(
|
||||
'OxSelect Ox' + Ox.toTitleCase(self.options.style)
|
||||
)
|
||||
|
|
@ -98,19 +111,6 @@ Ox.MenuButton = function(options, self) {
|
|||
that.triggerEvent('show');
|
||||
}
|
||||
|
||||
self.setOption = function(key, value) {
|
||||
if (key == 'title') {
|
||||
if (self.options.type == 'text') {
|
||||
self.$title.html(value);
|
||||
} else {
|
||||
self.$button.options({title: value});
|
||||
}
|
||||
} else if (key == 'width') {
|
||||
that.css({width: value - 2 + 'px'});
|
||||
self.$title.css({width: self.options.width - 24 + 'px'});
|
||||
}
|
||||
}
|
||||
|
||||
/*@
|
||||
checkItem <f> checkItem
|
||||
(id) -> <o> check item with id
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue