--- mootools.r743.original.js 2007-07-08 12:37:54.000000000 +0100 +++ mootools.r743.js 2007-07-08 12:40:21.000000000 +0100 @@ -4897,7 +4897,8 @@ Fx.Slide = Fx.Base.extend({ options: { - mode: 'vertical' + mode: 'vertical', + direction: 'normal' }, initialize: function(element, options){ @@ -4930,6 +4931,16 @@ this.offset = this.element.offsetWidth; }, + normal: function(){ + this.offset_margin = -this.offset; + this.offset_layout = 0; + }, + + reverse: function(){ + this.offset_margin = this.offset; + this.offset_layout = this.offset; + }, + /* Property: slideIn Slides the elements in view horizontally or vertically. @@ -4940,6 +4951,7 @@ slideIn: function(mode){ this[mode || this.options.mode](); + this.open = true; return this.start([this.element.getStyle(this.margin).toInt(), this.wrapper.getStyle(this.layout).toInt()], [0, this.offset]); }, @@ -4951,9 +4963,11 @@ mode - (optional, string) 'horizontal' or 'vertical'; defaults to options.mode. */ - slideOut: function(mode){ + slideOut: function(mode,dir){ this[mode || this.options.mode](); - return this.start([this.element.getStyle(this.margin).toInt(), this.wrapper.getStyle(this.layout).toInt()], [-this.offset, 0]); + this[dir || this.options.direction](); + this.open = false; + return this.start([this.element.getStyle(this.margin).toInt(), this.wrapper.getStyle(this.layout).toInt()], [this.offset_margin, this.offset_layout]); }, /* @@ -4994,8 +5008,8 @@ */ toggle: function(mode){ - if (this.wrapper.offsetHeight == 0 || this.wrapper.offsetWidth == 0) return this.slideIn(mode); - return this.slideOut(mode); + if (this.open) return this.slideOut(mode); + return this.slideIn(mode); }, increase: function(){ @@ -7774,4 +7788,4 @@ }); -Tips.implement(new Events, new Options); \ No newline at end of file +Tips.implement(new Events, new Options);