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
|
|
@ -45,6 +45,15 @@ Ox.Menu = function(options, self) {
|
|||
size: 'medium' // fixme: remove
|
||||
})
|
||||
.options(options || {})
|
||||
.update({
|
||||
items: function() {
|
||||
renderItems(self.options.items);
|
||||
},
|
||||
selected: function() {
|
||||
that.$content.find('.OxSelected').removeClass('OxSelected');
|
||||
selectItem(self.options.selected);
|
||||
}
|
||||
})
|
||||
.addClass(
|
||||
'OxMenu Ox' + Ox.toTitleCase(self.options.side) +
|
||||
' Ox' + Ox.toTitleCase(self.options.size)
|
||||
|
|
@ -567,15 +576,6 @@ Ox.Menu = function(options, self) {
|
|||
}
|
||||
}
|
||||
|
||||
self.setOption = function(key, value) {
|
||||
if (key == 'items') {
|
||||
renderItems(value);
|
||||
} else if (key == 'selected') {
|
||||
that.$content.find('.OxSelected').removeClass('OxSelected');
|
||||
selectItem(value);
|
||||
}
|
||||
}
|
||||
|
||||
/*@
|
||||
addItem <f>
|
||||
@*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue