[Pkg-mozext-commits] [tabmixplus] 21/22: Follow up bug 1368208 - Don't flush layout to determine whether scrollbox scroll buttons should be enabled/disabled
David Prévot
taffit at moszumanska.debian.org
Sat Aug 5 15:28:35 UTC 2017
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to tag 0.5.0.4pre.170625a1
in repository tabmixplus.
commit d423966d51a8206ef1822033bbcb24941a2e439a
Author: onemen <tabmix.onemen at gmail.com>
Date: Fri Jun 23 14:13:20 2017 +0300
Follow up bug 1368208 - Don't flush layout to determine whether scrollbox scroll buttons should be enabled/disabled
---
chrome/content/tab/scrollbox.xml | 33 ++++++++++++++++++++++++++++++++-
1 file changed, 32 insertions(+), 1 deletion(-)
diff --git a/chrome/content/tab/scrollbox.xml b/chrome/content/tab/scrollbox.xml
index 7d013e9..a3776a1 100644
--- a/chrome/content/tab/scrollbox.xml
+++ b/chrome/content/tab/scrollbox.xml
@@ -110,6 +110,13 @@
document.getAnonymousElementByAttribute(this._scrollbox, "class", "box-inherit scrollbox-innerbox");
</field>
+ <field name="scrollboxPaddingTop"><![CDATA[
+ parseFloat(window.getComputedStyle(this._scrollbox).paddingTop);
+ ]]></field>
+ <field name="scrollboxPaddingBottom"><![CDATA[
+ parseFloat(window.getComputedStyle(this._scrollbox).paddingBottom);
+ ]]></field>
+
<!-- we replace tabbrowser.xml "tabbrowser-arrowscrollbox" binding with this one
Override scrollbox.xml method, since our scrollbox's children are
inherited from the binding parent -->
@@ -211,7 +218,31 @@
'Math.abs(distance * (this.scrollbox.isMultiRow ? this.scrollbox._verticalAnimation : 1))'
).toCode();
- if (Tabmix.isVersion(320, 270)) {
+ if (Tabmix.isVersion(560)) {
+ let $LF = '\n ';
+ Tabmix.changeCode(this, "scrollbox._updateScrollButtonsDisabledState")._replace(
+ 'if (this.hasAttribute("notoverflowing")) {',
+ '$&' + $LF +
+ 'let box = document.getElementById("tabmixScrollBox");' + $LF +
+ 'Tabmix.setItem(box, "scrolledtoend", true);' + $LF +
+ 'Tabmix.setItem(box, "scrolledtostart", true);'
+ )._replace(
+ 'this.scrollboxPaddingStart',
+ 'this.isMultiRow ? this.scrollboxPaddingTop : $&'
+ )._replace(
+ 'this.scrollboxPaddingEnd',
+ 'this.isMultiRow ? this.scrollboxPaddingBottom : $&'
+ )._replace(
+ 'this._isRTLScrollbox',
+ '$& && !this.isMultiRow'
+ )._replace(
+ 'if (scrolledToEnd) {',
+ 'let box = document.getElementById("tabmixScrollBox");' + $LF +
+ ' Tabmix.setItem(box, "scrolledtoend", scrolledToEnd || null);' + $LF +
+ ' Tabmix.setItem(box, "scrolledtostart", scrolledToStart || null);' + $LF +
+ ' $&'
+ ).toCode();
+ } else if (Tabmix.isVersion(320, 270)) {
Tabmix.changeCode(this, "scrollbox._updateScrollButtonsDisabledState")._replace(
// when theme or extension add negative margin-bottom to the tab or
// tab content the scrollHeight can be larger than the actual
--
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