Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #7761 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

[PATCH] Effect.SlideUp bug causes effect to reset the element improperly (edge)

Reported by: sschristopher Assigned to: thomas@fesch.at
Priority: high Milestone:
Component: script.aculo.us Version:
Severity: normal Keywords: effects slideup
Cc:

Description

This bug is simple enough:

Effect.SlideUp begins by saving the bottom position of the inner element:

var oldInnerBottom = element.down().getStyle('bottom');

However, when it comes time to reset the position after the effect has run, this is what happens:

effect.element.hide().undoClipping().undoPositioned().setStyle({bottom: oldInnerBottom});
effect.element.down().undoPositioned();

The old bottom position of the inner element is being set onto the _containing_ element. This results in bizarre behaviour, such as the element jumping back to its starting position after the effect has run. I've attached a patch which fixes the problem by transferring the setStyle() call to the next line.

Attachments

effects_slideup.patch (312 bytes) - added by sschristopher on 03/08/07 06:12:23.
effects.js.diff (0.7 kB) - added by peterbex on 08/27/07 15:07:46.
alternative patch

Change History

03/08/07 06:12:23 changed by sschristopher

  • attachment effects_slideup.patch added.

03/08/07 17:13:34 changed by sschristopher

Ack, I only took a diff with local copies of the files to generate the patch. I don't think its valid. I'll generate one with CVS later today and reupload.

08/27/07 15:07:46 changed by peterbex

  • attachment effects.js.diff added.

alternative patch

08/27/07 15:09:34 changed by peterbex

Please implement this patch, it is trivial but necessary. This probably takes care of the bug 'Nate' reported on the discussion page of Effect.SlideDown. I'm seeing this as well. It breaks functionality when you have a div you slide down, then up, then down again. Then the content will 'pop' to the top of the container when the slide down is finished.

09/26/07 02:02:05 changed by Woil

  • priority changed from normal to high.

This patch fixes the bug. Please include.

09/26/07 05:29:50 changed by Woil

Bug #7412 needed this fix as well. I included it in my fix of #7412.

09/26/07 20:10:57 changed by madrobby

  • status changed from new to closed.
  • resolution set to fixed.

(In [7642]) script.aculo.us: Fix bottom CSS property reassignment and initialization in queues for Effect#SlideUp. Closes #7412, #7761.