Skip to content

Commit

Permalink
[BUG #5789] Fixed slide bar scrolling behavior. It won't stop the whe…
Browse files Browse the repository at this point in the history
…el event in case the slide bar has reached its end / start.
  • Loading branch information
wittemann committed Dec 22, 2011
1 parent af9caa5 commit cbc7fd2
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions framework/source/class/qx/ui/container/SlideBar.js
Expand Up @@ -331,15 +331,32 @@ qx.Class.define("qx.ui.container.SlideBar",
_onMouseWheel : function(e)
{
var delta = 0;
var pane = this.getChildControl("scrollpane");
if (this.getOrientation() === "horizontal") {
delta = e.getWheelDelta("x");

var position = pane.getScrollX();
var max = pane.getScrollMaxX();
var steps = parseInt(delta);

// pass the event to the parent if both scrollbars are at the end
if (!(steps < 0 && position <= 0 || steps > 0 && position >= max)) {
e.stop();
}
} else {
delta = e.getWheelDelta("y");

var position = pane.getScrollY();
var max = pane.getScrollMaxY();
var steps = parseInt(delta);

// pass the event to the parent if both scrollbars are at the end
if (!(steps < 0 && position <= 0 || steps > 0 && position >= max)) {
e.stop();
}
}
this.scrollBy(delta * this.getScrollStep());

// Stop bubbling and native event
e.stop();
this.scrollBy(delta * this.getScrollStep());
},


Expand Down

0 comments on commit cbc7fd2

Please sign in to comment.