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

Ticket #6134 (closed defect: untested)

Opened 2 years ago

Last modified 2 years ago

[PATCH] Allow empty restorecolor on Effect.Highlight

Reported by: jcott33@hotmail.com Assigned to: thomas@fesch.at
Priority: normal Milestone: 1.x
Component: script.aculo.us Version:
Severity: normal Keywords:
Cc:

Description

I noticed this while using a combination of drag & drop and Effect.Highlight. I had set a hoverclass to set background color on my Droppables, and used Effect.Highlight in the onDrop callback. But then I noticed that after one drop, the hoverclass was no longer having any effect. I traced this to the line:

if(!this.options.restorecolor)

in Effect.Highlight which of course means that Effect.Highlight will never restore an empty value background color, so the background color was simply stuck at white after the first drop. My change should allow a user to specify something like

restorecolor: ""

while still falling back to the default if no restorecolor is given at all.

I realize that a workaround would be to use the Droppables onHover callback to set the background color directly, but it seems more reasonable to allow Effect.Highlight to set the background color to be empty.

I checked on Firefox 1.5, IE 6, and Safari 2.0 to make sure this does what I think it does.

Attachments

effect_highlight_empty_restorecolor.diff (0.7 kB) - added by jcott33@hotmail.com on 09/08/06 21:54:52.
Diff against latest SVN
dragdrop_highlight_test.html (3.2 kB) - added by jcott33@hotmail.com on 09/11/06 23:23:15.
Functional test showing results of patch

Change History

09/08/06 21:54:52 changed by jcott33@hotmail.com

  • attachment effect_highlight_empty_restorecolor.diff added.

Diff against latest SVN

09/11/06 16:41:25 changed by madrobby

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

09/11/06 23:23:15 changed by jcott33@hotmail.com

  • attachment dragdrop_highlight_test.html added.

Functional test showing results of patch

09/11/06 23:25:36 changed by jcott33@hotmail.com

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

I've attached a functional test. The filename may need to be different, I suppose, since the patch actually affects Effect.Highlight, but it's really the combination of Effect.Highlight and drag and drop with hoverclass that shows what I mean.

Hope that helps.

09/12/06 23:01:11 changed by jcott33@hotmail.com

I should have probably checked through the tickets better before submitting this, but I appear to have more or less duplicated the following tickets:

Ticket #3454
Ticket #3738

09/13/06 12:31:49 changed by madrobby

  • status changed from reopened to closed.
  • resolution set to untested.

Any up to write a unit test for this? It should be possible to use the functional test as a starting point and do some automatic checking of what the styles look like before/after Effect.Highlight with the various options is called.