fix a split panel bug

This commit is contained in:
rlx 2011-09-05 01:30:35 +00:00
parent c123de8513
commit 5efe54c0e2
2 changed files with 2 additions and 4 deletions

View file

@ -126,14 +126,11 @@ Ox.Menu = function(options, self) {
}
if (item.options('checked') !== null) {
if (item.options('group')) {
//Ox.print('has group', item.options('group'))
toggled = self.optionGroups[item.options('group')].toggle(position);
//Ox.print('toggled', toggled)
if (toggled.length) {
toggled.forEach(function(pos) {
that.items[pos].toggleChecked();
});
//Ox.print('--triggering change event--');
menu.triggerEvent('change', {
id: item.options('group'),
checked: $.map(self.optionGroups[item.options('group')].checked(), function(v, i) {
@ -297,6 +294,7 @@ Ox.Menu = function(options, self) {
}
function getItemPositionById(id) {
// fixme: this exists in ox.js by now
var position;
Ox.forEach(that.items, function(item, i) {
if (item.options('id') == id) {

View file

@ -432,11 +432,11 @@ Ox.SplitPanel_ = function(options, self) {
element.collapsed = !element.collapsed;
css['margin' + Ox.toTitleCase(self.edges[0][index])] =
element.collapsed ? -size : 0;
Ox.print('css', css);
that.animate(css, 250, function() {
element.element.triggerEvent('toggle', {collapsed: element.collapsed});
triggerEvents('resize', pos);
});
self.$resizebars[pos == 0 ? 0 : 1].options({collapsed: element.collapsed});
}
}