in partnership with mediatemple

Ticket #1010 (closed defect: invalid)

Opened 2 days ago

Last modified 2 days ago

Clicking left/right of the knob of Slider broken in beta 1.2r2 when in relative positioned div

Reported by: sasoj Owned by:
Type: defect Priority: major
Milestone: Mootools version 1.2 Component: Plugins
Keywords: Slider Click Cc:

Description

Tested in browsers: IE7 and Firefox 3.0b5

When clicking left or right of the slider knob, the knob is not positioned properly. Seems like it is offset by the distance from the left edge of the div to left edge of the window.

The functionality worked properly in version 1.1.

I made a quick patch for myself that seems to fix the problem:
The following line from the clickedElement function was changed from

var position = event.page[this.axis] - this.element.getRelativePosition()[this.axis] - this.half;

To

var position = event.page[this.axis] - this.element.getPosition()[this.axis] - this.half;

This is a simple page that can be used to test the problem:

<?xml version="1.0" encoding="utf-8"?>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs" lang="cs">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><title>
	Untitled Page
</title>
<script src="mootools-beta-1.2b2.js" type="text/javascript"></script> 
</head>

<body>

    	<div style="margin:auto;width:400px">
    	<div style="position:relative;width:300px;left:50px">
    	<script type="text/javascript">
        window.addEvent('domready', function()
        {var mySlide2 = new Slider($('area2'), $('knob2'), {steps: 12});});
        </script>
        <div id="area2" style="background-color:Aqua;width:300px;height:20px">
	        <div id="knob2" style="background-color:Black;width:12px;height:20px"></div>
        </div>

        </div>
        </div>
</body>
</html> 

Change History

Changed 2 days ago by sasoj

  • summary changed from Positioning of the knob of Fx.Slider broken in beta 1.2r2 when in relative positioned div to Positioning of the knob of Slider broken in beta 1.2r2 when in relative positioned div

Changed 2 days ago by sasoj

  • summary changed from Positioning of the knob of Slider broken in beta 1.2r2 when in relative positioned div to Clicking left/right of the knob of Slider broken in beta 1.2r2 when in relative positioned div

Changed 2 days ago by kamicane

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

sorry, this is not a valid ticket.

  • Please be precise about the MooTools version / build you're using.
  • Please include a testcase where applicable.
  • We do not accept bug reports for beta browser versions.
  • Please include the full browser version.
  • Please test with trunk, as the bug might be already fixed.

In this case, the problem was already fixed.

Changed 2 days ago by kamicane

  • status changed from closed to reopened
  • resolution deleted

Changed 2 days ago by kamicane

  • status changed from reopened to closed
  • resolution set to invalid
Note: See TracTickets for help on using tickets.