1
0
Fork 0
forked from 0x2620/oxjs

self.setOption ~> that.update

This commit is contained in:
j 2012-05-28 19:35:41 +00:00
commit 005d50c389
56 changed files with 919 additions and 933 deletions

View file

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