add 'uncheckItem' method to menus and menubuttons, fix toggleSize in video editor
This commit is contained in:
parent
132e8d2207
commit
02696ae741
3 changed files with 14 additions and 3 deletions
|
@ -600,7 +600,7 @@ Ox.Menu = function(options, self) {
|
||||||
/*@
|
/*@
|
||||||
checkItem <f>
|
checkItem <f>
|
||||||
@*/
|
@*/
|
||||||
that.checkItem = function(id) {
|
that.checkItem = function(id, checked) {
|
||||||
Ox.Log('Menu', 'checkItem id', id)
|
Ox.Log('Menu', 'checkItem id', id)
|
||||||
var group,
|
var group,
|
||||||
ids = id.split('_'),
|
ids = id.split('_'),
|
||||||
|
@ -608,6 +608,7 @@ Ox.Menu = function(options, self) {
|
||||||
offset,
|
offset,
|
||||||
position,
|
position,
|
||||||
toggled;
|
toggled;
|
||||||
|
checked = Ox.isUndefined(checked) ? true : checked;
|
||||||
if (ids.length == 1) {
|
if (ids.length == 1) {
|
||||||
item = that.getItem(id);
|
item = that.getItem(id);
|
||||||
group = item.options('group');
|
group = item.options('group');
|
||||||
|
@ -621,7 +622,7 @@ Ox.Menu = function(options, self) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
item.options({checked: true});
|
item.options({checked: checked});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
that.submenus[ids.shift()].checkItem(ids.join('_'));
|
that.submenus[ids.shift()].checkItem(ids.join('_'));
|
||||||
|
@ -802,6 +803,10 @@ Ox.Menu = function(options, self) {
|
||||||
return that.is(':hidden') ? that.showMenu() : that.hideMenu();
|
return that.is(':hidden') ? that.showMenu() : that.hideMenu();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
that.uncheckItem = function(id) {
|
||||||
|
that.checkItem(id, false);
|
||||||
|
};
|
||||||
|
|
||||||
return that;
|
return that;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -150,6 +150,10 @@ Ox.MenuButton = function(options, self) {
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
that.uncheckItem = function(id) {
|
||||||
|
self.$menu.uncheckItem(id);
|
||||||
|
};
|
||||||
|
|
||||||
return that;
|
return that;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -1300,7 +1300,9 @@ Ox.VideoEditor = function(options, self) {
|
||||||
self.options.videoSize = self.options.videoSize == 'small'
|
self.options.videoSize = self.options.videoSize == 'small'
|
||||||
? 'large' : 'small';
|
? 'large' : 'small';
|
||||||
setSizes();
|
setSizes();
|
||||||
self.$menuButton.checkItem(self.options.videoSize);
|
self.$menuButton[
|
||||||
|
self.options.videoSize == 'small' ? 'uncheckItem' : 'checkItem'
|
||||||
|
]('size');
|
||||||
self.$player[0].options({
|
self.$player[0].options({
|
||||||
sizeIsLarge: self.options.videoSize == 'large'
|
sizeIsLarge: self.options.videoSize == 'large'
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue