[Pkg-mozext-commits] [tabmixplus] 36/48: Follow up changeset e8f23352d3a0 (bug 1356705) - scrollByIndex should call element.scrollIntoView with block = end when scrolling to the bottom (index > 0)

David Prévot taffit at moszumanska.debian.org
Sun Aug 20 03:14:37 UTC 2017


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository tabmixplus.

commit 957b1d24f9256935d101bd2ffef2b01bc5059786
Author: onemen <tabmix.onemen at gmail.com>
Date:   Tue Aug 15 09:00:45 2017 +0300

    Follow up changeset e8f23352d3a0 (bug 1356705) - scrollByIndex should call element.scrollIntoView with block = end when scrolling to the bottom (index > 0)
---
 chrome/content/tab/scrollbox.xml | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/chrome/content/tab/scrollbox.xml b/chrome/content/tab/scrollbox.xml
index ef33022..f870763 100644
--- a/chrome/content/tab/scrollbox.xml
+++ b/chrome/content/tab/scrollbox.xml
@@ -193,6 +193,25 @@
                }
                $&`
             ).toCode();
+
+            Tabmix.changeCode(this, "scrollbox.scrollByIndex")._replace(
+              'this.ensureElementIsVisible',
+              'scrollIntoView', {flags: "g"}
+            )._replace(
+              '{', `{
+              const block = index > 0 ? "end" : "start";
+              const scrollIntoView = (element, aInstant) => {
+                if (!this.isMultiRow) {
+                  this.ensureElementIsVisible(element, aInstant);
+                  return;
+                }
+                if (!this._canScrollToElement(element)) {
+                  return;
+                }
+                const behavior = aInstant ? "instant" : "auto";
+                element.scrollIntoView({behavior, block});
+              };`
+            ).toCode();
           } else {
             Tabmix.changeCode(this, "scrollbox.ensureElementIsVisible")._replace(
               'var amountToScroll',

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/tabmixplus.git



More information about the Pkg-mozext-commits mailing list