From 699ff332fde2e0cb9b48bd7f457468869d73a7e0 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Mon, 3 Jan 2011 14:00:28 +0000 Subject: [PATCH] add toggle event --- build/js/ox.ui.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/build/js/ox.ui.js b/build/js/ox.ui.js index eb3ac2a1..12b4ebeb 100644 --- a/build/js/ox.ui.js +++ b/build/js/ox.ui.js @@ -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]]() ); }); };