add toggle event

This commit is contained in:
rlx 2011-01-03 14:00:28 +00:00
parent e46ddfeb31
commit 106a7f7c9c

View File

@ -9282,23 +9282,23 @@ requires
animate = {};
Ox.print('s.o.e', self.options.edge);
*/
Ox.print('!!!! element', self.options.elements[getPositionById(id)], getPositionById(id), id);
var pos = Ox.isNumber(id) ? id : getPositionById(id),
element = self.options.elements[pos],
value = parseInt(that.css(self.edges[pos == 0 ? 0 : 1])) +
element.element[self.dimensions[0]]() *
(element.collapsed ? 1 : -1),
animate = {};
Ox.print('===', parseInt(that.css(self.edges[0])), element.element[self.dimensions[0]]())
animate[self.edges[pos == 0 ? 0 : 1]] = value;
Ox.print('animate', animate, 'value', value)
that.animate(animate, 200, function() {
var element = self.options.elements[pos == 0 ? 1 : pos - 1].element;
self.options.elements[pos].collapsed = !self.options.elements[pos].collapsed;
Ox.print('after animation, element', element, element.id, element.options('id'))
element.triggerEvent(
element.collapsed = !element.collapsed;
element.element.triggerEvent('toggle', {
'collapsed': element.collapsed
});
element = self.options.elements[pos == 0 ? 1 : pos - 1];
element.element.triggerEvent(
'resize',
element[self.dimensions[0]]()
element.element[self.dimensions[0]]()
);
});
};