Skip to content

Commit

Permalink
fix event propagation and scrollbarbutton
Browse files Browse the repository at this point in the history
  • Loading branch information
alice0775 committed Sep 9, 2019
1 parent 5994012 commit de715a1
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 8 deletions.
9 changes: 7 additions & 2 deletions 68/patchForBug1575485_wheelScrollOnScrollbarOfTree.uc.js
Expand Up @@ -5,6 +5,7 @@
// @include *
// @compatibility Firefox 67+
// @author Alice0775
// @version 2019/09/09 22:20 fix event propagation and scrollbarbutton
// @version 2019/09/09 workaround Bug 1575485 - Unable scroll Sidebar/Library window with turning the mouse wheel on scrollbar
// ==/UserScript==
var patchForBug1575485 = {
Expand Down Expand Up @@ -44,9 +45,13 @@ var patchForBug1575485 = {
var scrollView = event.target;
if (event.target.localName != "tree")
return;
if (event.originalTarget.orient == "vertical"){
event.stopPropagation();
var target = event.originalTarget;
if (target.localName == "scrollbarbutton")
target = target.parentNode;
if (target.orient == "vertical"){
this._scrollBy(scrollView, 0, event.deltaY);
} else if (event.originalTarget.orient == "horizontal"){
} else if (target.orient == "horizontal"){
this._scrollBy(scrollView, event.deltaY, 0);
}
}
Expand Down
9 changes: 7 additions & 2 deletions 69/patchForBug1575485_wheelScrollOnScrollbarOfTree.uc.js
Expand Up @@ -5,6 +5,7 @@
// @include *
// @compatibility Firefox 67+
// @author Alice0775
// @version 2019/09/09 22:20 fix event propagation and scrollbarbutton
// @version 2019/09/09 workaround Bug 1575485 - Unable scroll Sidebar/Library window with turning the mouse wheel on scrollbar
// ==/UserScript==
var patchForBug1575485 = {
Expand Down Expand Up @@ -44,9 +45,13 @@ var patchForBug1575485 = {
var scrollView = event.target;
if (event.target.localName != "tree")
return;
if (event.originalTarget.orient == "vertical"){
event.stopPropagation();
var target = event.originalTarget;
if (target.localName == "scrollbarbutton")
target = target.parentNode;
if (target.orient == "vertical"){
this._scrollBy(scrollView, 0, event.deltaY);
} else if (event.originalTarget.orient == "horizontal"){
} else if (target.orient == "horizontal"){
this._scrollBy(scrollView, event.deltaY, 0);
}
}
Expand Down
9 changes: 7 additions & 2 deletions 70/patchForBug1575485_wheelScrollOnScrollbarOfTree.uc.js
Expand Up @@ -5,6 +5,7 @@
// @include *
// @compatibility Firefox 67+
// @author Alice0775
// @version 2019/09/09 22:20 fix event propagation and scrollbarbutton
// @version 2019/09/09 workaround Bug 1575485 - Unable scroll Sidebar/Library window with turning the mouse wheel on scrollbar
// ==/UserScript==
var patchForBug1575485 = {
Expand Down Expand Up @@ -44,9 +45,13 @@ var patchForBug1575485 = {
var scrollView = event.target;
if (event.target.localName != "tree")
return;
if (event.originalTarget.orient == "vertical"){
event.stopPropagation();
var target = event.originalTarget;
if (target.localName == "scrollbarbutton")
target = target.parentNode;
if (target.orient == "vertical"){
this._scrollBy(scrollView, 0, event.deltaY);
} else if (event.originalTarget.orient == "horizontal"){
} else if (target.orient == "horizontal"){
this._scrollBy(scrollView, event.deltaY, 0);
}
}
Expand Down
9 changes: 7 additions & 2 deletions 71/patchForBug1575485_wheelScrollOnScrollbarOfTree.uc.js
Expand Up @@ -5,6 +5,7 @@
// @include *
// @compatibility Firefox 67+
// @author Alice0775
// @version 2019/09/09 22:20 fix event propagation and scrollbarbutton
// @version 2019/09/09 workaround Bug 1575485 - Unable scroll Sidebar/Library window with turning the mouse wheel on scrollbar
// ==/UserScript==
var patchForBug1575485 = {
Expand Down Expand Up @@ -44,9 +45,13 @@ var patchForBug1575485 = {
var scrollView = event.target;
if (event.target.localName != "tree")
return;
if (event.originalTarget.orient == "vertical"){
event.stopPropagation();
var target = event.originalTarget;
if (target.localName == "scrollbarbutton")
target = target.parentNode;
if (target.orient == "vertical"){
this._scrollBy(scrollView, 0, event.deltaY);
} else if (event.originalTarget.orient == "horizontal"){
} else if (target.orient == "horizontal"){
this._scrollBy(scrollView, event.deltaY, 0);
}
}
Expand Down

0 comments on commit de715a1

Please sign in to comment.