in partnership with mediatemple

Ticket #929 (new enhancement)

Opened 2 months ago

Last modified 2 days ago

Slide - toggling while slidingIn or out

Reported by: 3dcreator Owned by:
Type: enhancement Priority: trivial
Milestone: Mootools version 1.3 Component: Plugins
Keywords: Cc:

Description

While using slide with long time of animation user can fire event causing slide in while slider is sliding out and vice versa. This can cause some unsmooth animation - jumps.
I've modified slider code like this:

Added in initialize:

this.state = 'expanded';

and modified this:

this.addEvent('onComplete', function(){

this.open = (this.now[0] === 0);
if(this.open==true) this.state='expanded'
else this.state='collapsed';

});

and modified code of several functions:

slideIn: function(mode){

this.state='expanding';

this[mode this.options.mode]();
return this.start([this.element.getStyle(this.margin).toInt(), this.wrapper.getStyle(this.layout).toInt()], [0, this.offset]);

},

slideOut: function(mode){

this.state='collapsing';

this[mode this.options.mode]();
return this.start([this.element.getStyle(this.margin).toInt(), this.wrapper.getStyle(this.layout).toInt()], [-this.offset, 0]);

},

hide: function(mode){

this.state='collapsed';

this[mode this.options.mode]();
this.open = false;
return this.set([-this.offset, 0]);

},

show: function(mode){

this.state = 'expanded';

this[mode this.options.mode]();
this.open = true;
return this.set([0, this.offset]);

},

toggle: function(mode){

if((this.state == 'expanded') (this.state == 'expanding'))

{
this.state='collapsing';
return this.slideOut(mode);
}

else

{
this.state='expanding';
return this.slideIn(mode);
}

},

I believe that providing variable that contains current state of slider makes it better and easier to use.
Cheers
3Dcreator

Change History

Changed 2 days ago by tomocchino

  • milestone changed from Mootools version 1.2 to Mootools version 1.3

we may address this situation when we revamp the plugins for 1.3

Changed 2 days ago by tomocchino

  • owner deleted
  • priority changed from minor to trivial
  • component changed from Core to Plugins
  • milestone set to Mootools version 1.3

Changed 2 days ago by tomocchino

  • type changed from defect to enhancement
Note: See TracTickets for help on using tickets.