mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 902937 - Fixup scrollBy in StartUI.js and tests. r=mbrubeck
This commit is contained in:
parent
9c624067a5
commit
9ba71edfba
@ -95,14 +95,6 @@ var StartUI = {
|
||||
section.setAttribute("expanded", "true");
|
||||
},
|
||||
|
||||
getScrollBoxObject: function () {
|
||||
let startBox = document.getElementById("start-scrollbox");
|
||||
if (!startBox._cachedSBO) {
|
||||
startBox._cachedSBO = startBox.boxObject.QueryInterface(Ci.nsIScrollBoxObject);
|
||||
}
|
||||
return startBox._cachedSBO;
|
||||
},
|
||||
|
||||
handleEvent: function handleEvent(aEvent) {
|
||||
switch (aEvent.type) {
|
||||
case "MozPrecisePointer":
|
||||
@ -115,11 +107,10 @@ var StartUI = {
|
||||
this.onClick(aEvent);
|
||||
break;
|
||||
case "MozMousePixelScroll":
|
||||
let scroller = this.getScrollBoxObject();
|
||||
if (this.startUI.getAttribute("viewstate") == "snapped") {
|
||||
scroller.scrollBy(0, aEvent.detail);
|
||||
window.scrollBy(0, aEvent.detail);
|
||||
} else {
|
||||
scroller.scrollBy(aEvent.detail, 0);
|
||||
window.scrollBy(aEvent.detail, 0);
|
||||
}
|
||||
|
||||
aEvent.preventDefault();
|
||||
|
@ -12,8 +12,7 @@ function test() {
|
||||
}
|
||||
|
||||
function scrollToEnd() {
|
||||
let scroller = getBrowser().contentWindow.StartUI.getScrollBoxObject();
|
||||
scroller.scrollBy(50000, 0);
|
||||
getBrowser().contentWindow.scrollBy(50000, 0);
|
||||
}
|
||||
|
||||
function setup() {
|
||||
|
Loading…
Reference in New Issue
Block a user