mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-06 01:46:35 +00:00
Update pre-commit hook and upgrade lint-staged to version 15.3.0
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
diff --git a/browser/components/tabbrowser/content/tabs.js b/browser/components/tabbrowser/content/tabs.js
|
||||
index f7c39fe804182e2bdf53045ba3b6a5ba17079fc3..bddba0cb7b475ca7a8d0e58227c62f82b62e118b 100644
|
||||
index f7c39fe804182e2bdf53045ba3b6a5ba17079fc3..84359791101c500ed354da8d0b4bf3c7e8be4563 100644
|
||||
--- a/browser/components/tabbrowser/content/tabs.js
|
||||
+++ b/browser/components/tabbrowser/content/tabs.js
|
||||
@@ -649,7 +649,7 @@
|
||||
@@ -163,7 +163,7 @@ index f7c39fe804182e2bdf53045ba3b6a5ba17079fc3..bddba0cb7b475ca7a8d0e58227c62f82
|
||||
left: selectedTab.left,
|
||||
right: selectedTab.right,
|
||||
+ top: selectedTab.top,
|
||||
+ bottom: selectedTab.bottom
|
||||
+ bottom: selectedTab.bottom,
|
||||
};
|
||||
}
|
||||
return [
|
||||
@@ -174,57 +174,57 @@ index f7c39fe804182e2bdf53045ba3b6a5ba17079fc3..bddba0cb7b475ca7a8d0e58227c62f82
|
||||
selectedTab,
|
||||
];
|
||||
})
|
||||
@@ -2748,8 +2754,13 @@
|
||||
@@ -2748,8 +2754,11 @@
|
||||
delete this._lastTabToScrollIntoView;
|
||||
// Is the new tab already completely visible?
|
||||
if (
|
||||
- scrollRect.left <= tabRect.left &&
|
||||
- tabRect.right <= scrollRect.right
|
||||
+ this.verticalMode ? (
|
||||
+ scrollRect.top <= tabRect.top &&
|
||||
+ tabRect.bottom <= scrollRect.bottom
|
||||
+ ) : (
|
||||
+ scrollRect.left <= tabRect.left &&
|
||||
+ tabRect.right <= scrollRect.right
|
||||
+ )
|
||||
+ this.verticalMode
|
||||
+ ? scrollRect.top <= tabRect.top &&
|
||||
+ tabRect.bottom <= scrollRect.bottom
|
||||
+ : scrollRect.left <= tabRect.left &&
|
||||
+ tabRect.right <= scrollRect.right
|
||||
) {
|
||||
return;
|
||||
}
|
||||
@@ -2758,19 +2769,30 @@
|
||||
@@ -2757,21 +2766,29 @@
|
||||
if (this.arrowScrollbox.smoothScroll) {
|
||||
// Can we make both the new tab and the selected tab completely visible?
|
||||
if (
|
||||
!selectedRect ||
|
||||
- !selectedRect ||
|
||||
- Math.max(
|
||||
- tabRect.right - selectedRect.left,
|
||||
- selectedRect.right - tabRect.left
|
||||
- ) <= scrollRect.width
|
||||
+ this.verticalMode ? (
|
||||
+ Math.max(
|
||||
+ tabRect.bottom - selectedRect.top,
|
||||
+ selectedRect.bottom - tabRect.top
|
||||
+ ) <= scrollRect.height
|
||||
+ ) : (
|
||||
+ Math.max(
|
||||
+ tabRect.right - selectedRect.left,
|
||||
+ selectedRect.right - tabRect.left
|
||||
+ ) <= scrollRect.width
|
||||
+ )
|
||||
+ !selectedRect || this.verticalMode
|
||||
+ ? Math.max(
|
||||
+ tabRect.bottom - selectedRect.top,
|
||||
+ selectedRect.bottom - tabRect.top
|
||||
+ ) <= scrollRect.height
|
||||
+ : Math.max(
|
||||
+ tabRect.right - selectedRect.left,
|
||||
+ selectedRect.right - tabRect.left
|
||||
+ ) <= scrollRect.width
|
||||
) {
|
||||
this.arrowScrollbox.ensureElementIsVisible(tabToScrollIntoView);
|
||||
return;
|
||||
}
|
||||
|
||||
this.arrowScrollbox.scrollByPixels(
|
||||
- this.arrowScrollbox.scrollByPixels(
|
||||
- this.#rtlMode
|
||||
- ? selectedRect.right - scrollRect.right
|
||||
- : selectedRect.left - scrollRect.left
|
||||
+ this.verticalMode ? (
|
||||
+ tabRect.top - selectedRect.top
|
||||
+ ) : (
|
||||
+ this.#rtlMode
|
||||
+ ? selectedRect.right - scrollRect.right
|
||||
+ : selectedRect.left - scrollRect.left
|
||||
+ )
|
||||
);
|
||||
- );
|
||||
+ let scrollPixels;
|
||||
+ if (this.verticalMode) {
|
||||
+ scrollPixels = tabRect.top - selectedRect.top;
|
||||
+ } else if (this.#rtlMode) {
|
||||
+ scrollPixels = selectedRect.right - scrollRect.right;
|
||||
+ } else {
|
||||
+ scrollPixels = selectedRect.left - scrollRect.left;
|
||||
+ }
|
||||
+ this.arrowScrollbox.scrollByPixels(scrollPixels);
|
||||
}
|
||||
|
||||
if (!this._animateElement.hasAttribute("highlight")) {
|
||||
|
Reference in New Issue
Block a user