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

Ticket #7412 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

[PATCH] SlideUp + SlideDown results in sliding down and disappearing the element

Reported by: danbarnett Assigned to: madrobby
Priority: normal Milestone:
Component: script.aculo.us Version: edge
Severity: normal Keywords: effects
Cc:

Description

Please use the following code using scriptaculous 1.5 and then do the same with 1.7.

The below example should slide down and then slide up.

What should happen is what is on THIS site which uses 1.5 (not my site) ... http://blog.railsdevelopment.com/files/example1v2.html

You should see the differences - the final animation simply results in the div disappearing at the end instead of sliding up.

However, I can use the follow without too much problem, any more complicated and I run into problems also. Effect.Appear(\'content\', {queue: {position: \'front\', scope: \'menu\'}}); Effect.Fade(\'content\', {queue: {position: \'end\', scope: \'menu\'}});

I am using the latest version of IE (v7) and Firefox (v2). Win XP.

I would really like to know when you fix this.

Thanks, Daniel Barnett.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Effect.Queue example 1</title>
<script src="/javascripts/prototype.js" type="text/javascript"></script>
<script src="/javascripts/scriptaculous.js" type="text/javascript"></script>
<script type="text/javascript">
  Event.observe(window, 'load', function() { // this binds the function() to the event window.onload
	new Effect.SlideDown('test1'); // create first Effect
	new Effect.SlideUp('test1', {queue: 'end'} ); // create second Effect
  });
</script>
</head>
<body>

This only shows you some flickering. Refresh if you didn't see anything.

<div id="test1" style="display:none;">

	<div style="background: red; margin: 50px; padding: 50px;">
	testing how to styles can collide
	</div>
</div>

</body>
</html>

Attachments

effects.js.diff (1.3 kB) - added by Woil on 09/26/07 05:21:17.
This patch fixes both ticket #7412 and #7761

Change History

07/20/07 14:55:53 changed by sokrat3s

  • status changed from new to assigned.
  • severity changed from critical to normal.
  • summary changed from Combination effects are broken in latest version to SlideUp + SlideDown results in sliding down and disappearing the elemnt.
  • priority changed from high to normal.
  • owner changed from madrobby to sokrat3s.
  • milestone deleted.
  • keywords changed from Combination, effects to effects.

07/20/07 14:57:03 changed by sokrat3s

  • owner changed from sokrat3s to madrobby.
  • status changed from assigned to new.

07/20/07 14:57:26 changed by sokrat3s

  • summary changed from SlideUp + SlideDown results in sliding down and disappearing the elemnt to SlideUp + SlideDown results in sliding down and disappearing the element.

09/26/07 05:21:17 changed by Woil

  • attachment effects.js.diff added.

This patch fixes both ticket #7412 and #7761

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

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

FIXED

A number of things caused this bug and bug #7761. First, as mentioned in bug #7761, the style was being set to the wrong element, an easy fix. Then SlideUp was using beforeStartInternal where SlideDown was using afterSetup to make the positioning changes. Because all of the the beforeStartInternal are called when the queue begins, all of the SlideUp initialization was running at the wrong time. Then the issue of the padding / margin being cut off was caused because clipped elements calculate padding / margin differently. This is fixed now in this version of SlideUp.

Perhaps we should change SlideUp and SlideDown to be simply Slide with a direction indicator in the options (up/down/left/right) ?

09/26/07 05:27:49 changed by Woil

p.s. I don't know if I should mark it as fixed if it isn't yet included in the most recent version?

09/26/07 08:01:04 changed by tarmo

  • status changed from closed to reopened.
  • resolution deleted.

It's not fixed unless it is commited to svn.

09/26/07 13:26:59 changed by Woil

  • summary changed from SlideUp + SlideDown results in sliding down and disappearing the element to [PATCH] SlideUp + SlideDown results in sliding down and disappearing the element.

Changing summary because patch is applied. Thanks tarmo.

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

  • status changed from reopened 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.