1
0
Fork 0
forked from 0x2620/oxjs

add 'uncheckItem' method to menus and menubuttons, fix toggleSize in video editor

This commit is contained in:
rlx 2012-04-18 07:57:59 +00:00
commit 02696ae741
3 changed files with 14 additions and 3 deletions

View file

@ -600,7 +600,7 @@ Ox.Menu = function(options, self) {
/*@
checkItem <f>
@*/
that.checkItem = function(id) {
that.checkItem = function(id, checked) {
Ox.Log('Menu', 'checkItem id', id)
var group,
ids = id.split('_'),
@ -608,6 +608,7 @@ Ox.Menu = function(options, self) {
offset,
position,
toggled;
checked = Ox.isUndefined(checked) ? true : checked;
if (ids.length == 1) {
item = that.getItem(id);
group = item.options('group');
@ -621,7 +622,7 @@ Ox.Menu = function(options, self) {
});
}
} else {
item.options({checked: true});
item.options({checked: checked});
}
} else {
that.submenus[ids.shift()].checkItem(ids.join('_'));
@ -802,6 +803,10 @@ Ox.Menu = function(options, self) {
return that.is(':hidden') ? that.showMenu() : that.hideMenu();
};
that.uncheckItem = function(id) {
that.checkItem(id, false);
};
return that;
};