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

Ticket #5338 (closed defect: untested)

Opened 3 years ago

Last modified 2 years ago

[PATCH] browser crash if track uses nested elements for sliders

Reported by: anonymous Assigned to: Rails
Priority: normal Milestone:
Component: script.aculo.us Version:
Severity: normal Keywords: slider
Cc:

Description

if you try to use nested html elements for the track of a slider component, the slider script will fail. (it assumes that if handle!=Event.element(event) you clicked the handle - which is not true)

HTML:

<div id="slider">
  <img src="slider-bg.png" id="slider-bg-img">
  <div id="slider-handle"><img src="handle.png"></div>
</div>

note: i can't set the image as the style.background because i need the image to scale.

this is a (for me) working fix to this problem:

slider.js:220 ff

// try to find the track
var track = handle;
while((track != this.track) && track.parentNode) 
  track = track.parentNode;
  if(track==this.track) {
    ...

Change History

06/09/06 10:47:22 changed by madrobby

This breaks sliders with multiple handles for me (see the functional slider test, under headline "Slider with multiple handles, external controls, handles are restricted (can't be moved prior/after adjacent handles)" -- you can't move the green handle with #5338 applied.

12/08/06 11:49:34 changed by IntuiCat

You should be able to do :

<div id="slider">
  <img src="slider-bg.png" id="slider-bg-img">
  <img src="handle.png" id="slider-handle"/>
</div>

01/15/07 16:51:05 changed by madrobby

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

Please add proper patch and tests.