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
|
|
@ -41,6 +41,18 @@ Ox.MenuItem = function(options, self) {
|
|||
keyboard: parseKeyboard(options.keyboard || self.defaults.keyboard),
|
||||
title: Ox.makeArray(options.title || self.defaults.title)
|
||||
}))
|
||||
.update({
|
||||
checked: function() {
|
||||
that.$status.html(self.options.checked ? Ox.UI.symbols.check : '')
|
||||
},
|
||||
disabled: function() {
|
||||
that.toggleClass('OxDisabled');
|
||||
},
|
||||
title: function() {
|
||||
self.options.title = Ox.makeArray(self.options.title);
|
||||
that.$title.html(self.options.title[0]);
|
||||
}
|
||||
})
|
||||
.addClass('OxItem' + (self.options.disabled ? ' OxDisabled' : ''))
|
||||
/*
|
||||
.attr({
|
||||
|
|
@ -124,20 +136,6 @@ Ox.MenuItem = function(options, self) {
|
|||
};
|
||||
}
|
||||
|
||||
/*@
|
||||
setOption <f> setOption
|
||||
@*/
|
||||
self.setOption = function(key, value) {
|
||||
if (key == 'checked') {
|
||||
that.$status.html(value ? Ox.UI.symbols.check : '')
|
||||
} else if (key == 'disabled') {
|
||||
that.toggleClass('OxDisabled');
|
||||
} else if (key == 'title') {
|
||||
self.options.title = Ox.makeArray(value);
|
||||
that.$title.html(self.options.title[0]);
|
||||
}
|
||||
};
|
||||
|
||||
that.toggle = function() {
|
||||
// toggle id and title
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue