mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-03 16:36:35 +00:00
fix: Fixed CTRL + arrow does not move cursor when renaming workspace, b=closes #10115, c=tabs
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
|
diff --git a/browser/components/tabbrowser/content/tabs.js b/browser/components/tabbrowser/content/tabs.js
|
||||||
index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c3b65f80b 100644
|
index e2b27db6c13278defea3bcc7606a8da54e7d001c..db0c8da40e626354895421190ca5d6e3f397fc45 100644
|
||||||
--- a/browser/components/tabbrowser/content/tabs.js
|
--- a/browser/components/tabbrowser/content/tabs.js
|
||||||
+++ b/browser/components/tabbrowser/content/tabs.js
|
+++ b/browser/components/tabbrowser/content/tabs.js
|
||||||
@@ -332,7 +332,7 @@
|
@@ -332,7 +332,7 @@
|
||||||
@@ -19,7 +19,17 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
} else if (
|
} else if (
|
||||||
event.originalTarget.closest("scrollbox") &&
|
event.originalTarget.closest("scrollbox") &&
|
||||||
!Services.prefs.getBoolPref(
|
!Services.prefs.getBoolPref(
|
||||||
@@ -686,7 +685,7 @@
|
@@ -449,6 +448,9 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
on_keydown(event) {
|
||||||
|
+ if (document.documentElement.getAttribute('zen-renaming-tab') === 'true') {
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
let { altKey, shiftKey } = event;
|
||||||
|
let [accel, nonAccel] =
|
||||||
|
AppConstants.platform == "macosx"
|
||||||
|
@@ -686,7 +688,7 @@
|
||||||
if (this.#isContainerVerticalPinnedGrid(tab)) {
|
if (this.#isContainerVerticalPinnedGrid(tab)) {
|
||||||
// In expanded vertical mode, the max number of pinned tabs per row is dynamic
|
// In expanded vertical mode, the max number of pinned tabs per row is dynamic
|
||||||
// Set this before adjusting dragged tab's position
|
// Set this before adjusting dragged tab's position
|
||||||
@@ -28,7 +38,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
let tabsPerRow = 0;
|
let tabsPerRow = 0;
|
||||||
let position = RTL_UI
|
let position = RTL_UI
|
||||||
? window.windowUtils.getBoundsWithoutFlushing(
|
? window.windowUtils.getBoundsWithoutFlushing(
|
||||||
@@ -851,7 +850,7 @@
|
@@ -851,7 +853,7 @@
|
||||||
let dropEffect = this.getDropEffectForTabDrag(event);
|
let dropEffect = this.getDropEffectForTabDrag(event);
|
||||||
let isMovingInTabStrip = !fromTabList && dropEffect == "move";
|
let isMovingInTabStrip = !fromTabList && dropEffect == "move";
|
||||||
let collapseTabGroupDuringDrag =
|
let collapseTabGroupDuringDrag =
|
||||||
@@ -37,7 +47,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
|
|
||||||
tab._dragData = {
|
tab._dragData = {
|
||||||
offsetX: this.verticalMode
|
offsetX: this.verticalMode
|
||||||
@@ -861,7 +860,7 @@
|
@@ -861,7 +863,7 @@
|
||||||
? event.screenY - window.screenY - tabOffset
|
? event.screenY - window.screenY - tabOffset
|
||||||
: event.screenY - window.screenY,
|
: event.screenY - window.screenY,
|
||||||
scrollPos:
|
scrollPos:
|
||||||
@@ -46,7 +56,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
? this.pinnedTabsContainer.scrollPosition
|
? this.pinnedTabsContainer.scrollPosition
|
||||||
: this.arrowScrollbox.scrollPosition,
|
: this.arrowScrollbox.scrollPosition,
|
||||||
screenX: event.screenX,
|
screenX: event.screenX,
|
||||||
@@ -886,6 +885,7 @@
|
@@ -886,6 +888,7 @@
|
||||||
if (tab.multiselected) {
|
if (tab.multiselected) {
|
||||||
this.#moveTogetherSelectedTabs(tab);
|
this.#moveTogetherSelectedTabs(tab);
|
||||||
} else if (collapseTabGroupDuringDrag) {
|
} else if (collapseTabGroupDuringDrag) {
|
||||||
@@ -54,7 +64,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
tab.group.collapsed = true;
|
tab.group.collapsed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -932,6 +932,10 @@
|
@@ -932,6 +935,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
let draggedTab = event.dataTransfer.mozGetDataAt(TAB_DROP_TYPE, 0);
|
let draggedTab = event.dataTransfer.mozGetDataAt(TAB_DROP_TYPE, 0);
|
||||||
@@ -65,7 +75,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
if (
|
if (
|
||||||
(dropEffect == "move" || dropEffect == "copy") &&
|
(dropEffect == "move" || dropEffect == "copy") &&
|
||||||
document == draggedTab.ownerDocument &&
|
document == draggedTab.ownerDocument &&
|
||||||
@@ -1059,7 +1063,9 @@
|
@@ -1059,7 +1066,9 @@
|
||||||
isTabGroupLabel(draggedTab) &&
|
isTabGroupLabel(draggedTab) &&
|
||||||
draggedTab._dragData?.expandGroupOnDrop
|
draggedTab._dragData?.expandGroupOnDrop
|
||||||
) {
|
) {
|
||||||
@@ -76,7 +86,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1095,6 +1101,18 @@
|
@@ -1095,6 +1104,18 @@
|
||||||
|
|
||||||
this._tabDropIndicator.hidden = true;
|
this._tabDropIndicator.hidden = true;
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
@@ -95,7 +105,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
if (draggedTab && dropEffect == "copy") {
|
if (draggedTab && dropEffect == "copy") {
|
||||||
let duplicatedDraggedTab;
|
let duplicatedDraggedTab;
|
||||||
let duplicatedTabs = [];
|
let duplicatedTabs = [];
|
||||||
@@ -1119,8 +1137,9 @@
|
@@ -1119,8 +1140,9 @@
|
||||||
let translateOffsetY = oldTranslateY % tabHeight;
|
let translateOffsetY = oldTranslateY % tabHeight;
|
||||||
let newTranslateX = oldTranslateX - translateOffsetX;
|
let newTranslateX = oldTranslateX - translateOffsetX;
|
||||||
let newTranslateY = oldTranslateY - translateOffsetY;
|
let newTranslateY = oldTranslateY - translateOffsetY;
|
||||||
@@ -107,7 +117,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
|
|
||||||
if (this.#isContainerVerticalPinnedGrid(draggedTab)) {
|
if (this.#isContainerVerticalPinnedGrid(draggedTab)) {
|
||||||
// Update both translate axis for pinned vertical expanded tabs
|
// Update both translate axis for pinned vertical expanded tabs
|
||||||
@@ -1136,8 +1155,8 @@
|
@@ -1136,8 +1158,8 @@
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let tabs = this.ariaFocusableItems.slice(
|
let tabs = this.ariaFocusableItems.slice(
|
||||||
@@ -118,7 +128,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
);
|
);
|
||||||
let size = this.verticalMode ? "height" : "width";
|
let size = this.verticalMode ? "height" : "width";
|
||||||
let screenAxis = this.verticalMode ? "screenY" : "screenX";
|
let screenAxis = this.verticalMode ? "screenY" : "screenX";
|
||||||
@@ -1178,11 +1197,9 @@
|
@@ -1178,11 +1200,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
let shouldPin =
|
let shouldPin =
|
||||||
@@ -132,7 +142,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
let shouldTranslate =
|
let shouldTranslate =
|
||||||
!gReduceMotion &&
|
!gReduceMotion &&
|
||||||
!shouldCreateGroupOnDrop &&
|
!shouldCreateGroupOnDrop &&
|
||||||
@@ -1195,6 +1212,7 @@
|
@@ -1195,6 +1215,7 @@
|
||||||
(oldTranslateY && oldTranslateY != newTranslateY);
|
(oldTranslateY && oldTranslateY != newTranslateY);
|
||||||
} else if (this.verticalMode) {
|
} else if (this.verticalMode) {
|
||||||
shouldTranslate &&= oldTranslateY && oldTranslateY != newTranslateY;
|
shouldTranslate &&= oldTranslateY && oldTranslateY != newTranslateY;
|
||||||
@@ -140,7 +150,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
} else {
|
} else {
|
||||||
shouldTranslate &&= oldTranslateX && oldTranslateX != newTranslateX;
|
shouldTranslate &&= oldTranslateX && oldTranslateX != newTranslateX;
|
||||||
}
|
}
|
||||||
@@ -1376,6 +1394,7 @@
|
@@ -1376,6 +1397,7 @@
|
||||||
|
|
||||||
let nextItem = this.ariaFocusableItems[newIndex];
|
let nextItem = this.ariaFocusableItems[newIndex];
|
||||||
let tabGroup = isTab(nextItem) && nextItem.group;
|
let tabGroup = isTab(nextItem) && nextItem.group;
|
||||||
@@ -148,7 +158,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
gBrowser.loadTabs(urls, {
|
gBrowser.loadTabs(urls, {
|
||||||
inBackground,
|
inBackground,
|
||||||
replace,
|
replace,
|
||||||
@@ -1408,6 +1427,17 @@
|
@@ -1408,6 +1430,17 @@
|
||||||
|
|
||||||
this.finishMoveTogetherSelectedTabs(draggedTab);
|
this.finishMoveTogetherSelectedTabs(draggedTab);
|
||||||
this.finishAnimateTabMove();
|
this.finishAnimateTabMove();
|
||||||
@@ -166,7 +176,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
this.#expandGroupOnDrop(draggedTab);
|
this.#expandGroupOnDrop(draggedTab);
|
||||||
this.#resetTabsAfterDrop(draggedTab.ownerDocument);
|
this.#resetTabsAfterDrop(draggedTab.ownerDocument);
|
||||||
|
|
||||||
@@ -1577,7 +1607,6 @@
|
@@ -1577,7 +1610,6 @@
|
||||||
|
|
||||||
this.toggleAttribute("overflow", true);
|
this.toggleAttribute("overflow", true);
|
||||||
this._updateCloseButtons();
|
this._updateCloseButtons();
|
||||||
@@ -174,7 +184,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
|
|
||||||
document
|
document
|
||||||
.getElementById("tab-preview-panel")
|
.getElementById("tab-preview-panel")
|
||||||
@@ -1635,7 +1664,7 @@
|
@@ -1635,7 +1667,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
get newTabButton() {
|
get newTabButton() {
|
||||||
@@ -183,7 +193,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
}
|
}
|
||||||
|
|
||||||
get verticalMode() {
|
get verticalMode() {
|
||||||
@@ -1651,6 +1680,7 @@
|
@@ -1651,6 +1683,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
get overflowing() {
|
get overflowing() {
|
||||||
@@ -191,7 +201,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
return this.hasAttribute("overflow");
|
return this.hasAttribute("overflow");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1659,26 +1689,54 @@
|
@@ -1659,26 +1692,54 @@
|
||||||
if (this.#allTabs) {
|
if (this.#allTabs) {
|
||||||
return this.#allTabs;
|
return this.#allTabs;
|
||||||
}
|
}
|
||||||
@@ -253,7 +263,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1745,32 +1803,27 @@
|
@@ -1745,32 +1806,27 @@
|
||||||
|
|
||||||
let elementIndex = 0;
|
let elementIndex = 0;
|
||||||
|
|
||||||
@@ -295,7 +305,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
|
|
||||||
return this.#focusableItems;
|
return this.#focusableItems;
|
||||||
}
|
}
|
||||||
@@ -1778,6 +1831,7 @@
|
@@ -1778,6 +1834,7 @@
|
||||||
_invalidateCachedTabs() {
|
_invalidateCachedTabs() {
|
||||||
this.#allTabs = null;
|
this.#allTabs = null;
|
||||||
this._invalidateCachedVisibleTabs();
|
this._invalidateCachedVisibleTabs();
|
||||||
@@ -303,7 +313,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
}
|
}
|
||||||
|
|
||||||
_invalidateCachedVisibleTabs() {
|
_invalidateCachedVisibleTabs() {
|
||||||
@@ -1793,8 +1847,8 @@
|
@@ -1793,8 +1850,8 @@
|
||||||
#isContainerVerticalPinnedGrid(tab) {
|
#isContainerVerticalPinnedGrid(tab) {
|
||||||
return (
|
return (
|
||||||
this.verticalMode &&
|
this.verticalMode &&
|
||||||
@@ -314,7 +324,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
!this.expandOnHover
|
!this.expandOnHover
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -1810,7 +1864,7 @@
|
@@ -1810,7 +1867,7 @@
|
||||||
|
|
||||||
if (node == null) {
|
if (node == null) {
|
||||||
// We have a container for non-tab elements at the end of the scrollbox.
|
// We have a container for non-tab elements at the end of the scrollbox.
|
||||||
@@ -323,7 +333,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
}
|
}
|
||||||
|
|
||||||
node.before(tab);
|
node.before(tab);
|
||||||
@@ -1905,7 +1959,7 @@
|
@@ -1905,7 +1962,7 @@
|
||||||
// There are separate "new tab" buttons for horizontal tabs toolbar, vertical tabs and
|
// There are separate "new tab" buttons for horizontal tabs toolbar, vertical tabs and
|
||||||
// for when the tab strip is overflowed (which is shared by vertical and horizontal tabs);
|
// for when the tab strip is overflowed (which is shared by vertical and horizontal tabs);
|
||||||
// Attach the long click popup to all of them.
|
// Attach the long click popup to all of them.
|
||||||
@@ -332,7 +342,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
const newTab2 = this.newTabButton;
|
const newTab2 = this.newTabButton;
|
||||||
const newTabVertical = document.getElementById(
|
const newTabVertical = document.getElementById(
|
||||||
"vertical-tabs-newtab-button"
|
"vertical-tabs-newtab-button"
|
||||||
@@ -2000,10 +2054,12 @@
|
@@ -2000,10 +2057,12 @@
|
||||||
|
|
||||||
_handleTabSelect(aInstant) {
|
_handleTabSelect(aInstant) {
|
||||||
let selectedTab = this.selectedItem;
|
let selectedTab = this.selectedItem;
|
||||||
@@ -345,7 +355,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
selectedTab._notselectedsinceload = false;
|
selectedTab._notselectedsinceload = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2140,6 +2196,16 @@
|
@@ -2140,6 +2199,16 @@
|
||||||
when the tab is first selected to be dragged.
|
when the tab is first selected to be dragged.
|
||||||
*/
|
*/
|
||||||
#updateTabStylesOnDrag(tab) {
|
#updateTabStylesOnDrag(tab) {
|
||||||
@@ -362,7 +372,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
let isPinned = tab.pinned;
|
let isPinned = tab.pinned;
|
||||||
let numPinned = gBrowser.pinnedTabCount;
|
let numPinned = gBrowser.pinnedTabCount;
|
||||||
let allTabs = this.ariaFocusableItems;
|
let allTabs = this.ariaFocusableItems;
|
||||||
@@ -2398,7 +2464,7 @@
|
@@ -2398,7 +2467,7 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -371,7 +381,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
|
|
||||||
let directionX = screenX > dragData.animLastScreenX;
|
let directionX = screenX > dragData.animLastScreenX;
|
||||||
let directionY = screenY > dragData.animLastScreenY;
|
let directionY = screenY > dragData.animLastScreenY;
|
||||||
@@ -2407,6 +2473,8 @@
|
@@ -2407,6 +2476,8 @@
|
||||||
|
|
||||||
let { width: tabWidth, height: tabHeight } =
|
let { width: tabWidth, height: tabHeight } =
|
||||||
draggedTab.getBoundingClientRect();
|
draggedTab.getBoundingClientRect();
|
||||||
@@ -380,7 +390,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
let shiftSizeX = tabWidth * movingTabs.length;
|
let shiftSizeX = tabWidth * movingTabs.length;
|
||||||
let shiftSizeY = tabHeight;
|
let shiftSizeY = tabHeight;
|
||||||
dragData.tabWidth = tabWidth;
|
dragData.tabWidth = tabWidth;
|
||||||
@@ -2443,8 +2511,8 @@
|
@@ -2443,8 +2514,8 @@
|
||||||
let lastBoundX =
|
let lastBoundX =
|
||||||
lastTabInRow.screenX +
|
lastTabInRow.screenX +
|
||||||
lastTabInRow.getBoundingClientRect().width -
|
lastTabInRow.getBoundingClientRect().width -
|
||||||
@@ -391,7 +401,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
translateX = Math.min(Math.max(translateX, firstBoundX), lastBoundX);
|
translateX = Math.min(Math.max(translateX, firstBoundX), lastBoundX);
|
||||||
translateY = Math.min(Math.max(translateY, firstBoundY), lastBoundY);
|
translateY = Math.min(Math.max(translateY, firstBoundY), lastBoundY);
|
||||||
|
|
||||||
@@ -2560,7 +2628,7 @@
|
@@ -2560,7 +2631,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
dragData.animDropElementIndex = newIndex;
|
dragData.animDropElementIndex = newIndex;
|
||||||
@@ -400,7 +410,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
dragData.dropBefore = newIndex < tabs.length;
|
dragData.dropBefore = newIndex < tabs.length;
|
||||||
|
|
||||||
// Shift background tabs to leave a gap where the dragged tab
|
// Shift background tabs to leave a gap where the dragged tab
|
||||||
@@ -2593,13 +2661,18 @@
|
@@ -2593,13 +2664,18 @@
|
||||||
|
|
||||||
this.#clearDragOverCreateGroupTimer();
|
this.#clearDragOverCreateGroupTimer();
|
||||||
|
|
||||||
@@ -423,7 +433,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
|
|
||||||
if (this.#rtlMode) {
|
if (this.#rtlMode) {
|
||||||
tabs.reverse();
|
tabs.reverse();
|
||||||
@@ -2610,7 +2683,7 @@
|
@@ -2610,7 +2686,7 @@
|
||||||
let screenAxis = this.verticalMode ? "screenY" : "screenX";
|
let screenAxis = this.verticalMode ? "screenY" : "screenX";
|
||||||
let size = this.verticalMode ? "height" : "width";
|
let size = this.verticalMode ? "height" : "width";
|
||||||
let translateAxis = this.verticalMode ? "translateY" : "translateX";
|
let translateAxis = this.verticalMode ? "translateY" : "translateX";
|
||||||
@@ -432,7 +442,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
let translateX = event.screenX - dragData.screenX;
|
let translateX = event.screenX - dragData.screenX;
|
||||||
let translateY = event.screenY - dragData.screenY;
|
let translateY = event.screenY - dragData.screenY;
|
||||||
|
|
||||||
@@ -2620,10 +2693,16 @@
|
@@ -2620,10 +2696,16 @@
|
||||||
dragData.translateY = translateY;
|
dragData.translateY = translateY;
|
||||||
|
|
||||||
// Move the dragged tab based on the mouse position.
|
// Move the dragged tab based on the mouse position.
|
||||||
@@ -451,7 +461,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
let endEdge = ele => ele[screenAxis] + bounds(ele)[size];
|
let endEdge = ele => ele[screenAxis] + bounds(ele)[size];
|
||||||
let lastMovingTabScreen = endEdge(lastMovingTab);
|
let lastMovingTabScreen = endEdge(lastMovingTab);
|
||||||
let firstMovingTabScreen = firstMovingTab[screenAxis];
|
let firstMovingTabScreen = firstMovingTab[screenAxis];
|
||||||
@@ -2632,6 +2711,7 @@
|
@@ -2632,6 +2714,7 @@
|
||||||
// Constrain the range over which the moving tabs can move between the first and last tab
|
// Constrain the range over which the moving tabs can move between the first and last tab
|
||||||
let firstBound = firstTab[screenAxis] - firstMovingTabScreen;
|
let firstBound = firstTab[screenAxis] - firstMovingTabScreen;
|
||||||
let lastBound = endEdge(lastTab) - lastMovingTabScreen;
|
let lastBound = endEdge(lastTab) - lastMovingTabScreen;
|
||||||
@@ -459,7 +469,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
|
|
||||||
// Center the tab under the cursor if the tab is not under the cursor while dragging
|
// Center the tab under the cursor if the tab is not under the cursor while dragging
|
||||||
if (
|
if (
|
||||||
@@ -2649,6 +2729,9 @@
|
@@ -2649,6 +2732,9 @@
|
||||||
// Shift the `.tab-group-label-container` to shift the label element.
|
// Shift the `.tab-group-label-container` to shift the label element.
|
||||||
item = item.parentElement;
|
item = item.parentElement;
|
||||||
}
|
}
|
||||||
@@ -469,7 +479,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
item.style.transform = `${translateAxis}(${translate}px)`;
|
item.style.transform = `${translateAxis}(${translate}px)`;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2786,6 +2869,9 @@
|
@@ -2786,6 +2872,9 @@
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
let element = tabs[mid];
|
let element = tabs[mid];
|
||||||
@@ -479,7 +489,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
let elementForSize = isTabGroupLabel(element)
|
let elementForSize = isTabGroupLabel(element)
|
||||||
? element.parentElement
|
? element.parentElement
|
||||||
: element;
|
: element;
|
||||||
@@ -2805,6 +2891,8 @@
|
@@ -2805,6 +2894,8 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
let dropElement = getOverlappedElement();
|
let dropElement = getOverlappedElement();
|
||||||
@@ -488,7 +498,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
|
|
||||||
let newDropElementIndex;
|
let newDropElementIndex;
|
||||||
if (dropElement) {
|
if (dropElement) {
|
||||||
@@ -2869,7 +2957,10 @@
|
@@ -2869,7 +2960,10 @@
|
||||||
let shouldCreateGroupOnDrop;
|
let shouldCreateGroupOnDrop;
|
||||||
let dropBefore;
|
let dropBefore;
|
||||||
if (dropElement) {
|
if (dropElement) {
|
||||||
@@ -500,7 +510,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
? dropElement.parentElement
|
? dropElement.parentElement
|
||||||
: dropElement;
|
: dropElement;
|
||||||
|
|
||||||
@@ -2889,7 +2980,7 @@
|
@@ -2889,7 +2983,7 @@
|
||||||
? Services.prefs.getIntPref(
|
? Services.prefs.getIntPref(
|
||||||
"browser.tabs.dragDrop.moveOverThresholdPercent"
|
"browser.tabs.dragDrop.moveOverThresholdPercent"
|
||||||
) / 100
|
) / 100
|
||||||
@@ -509,7 +519,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
moveOverThreshold = Math.min(1, Math.max(0, moveOverThreshold));
|
moveOverThreshold = Math.min(1, Math.max(0, moveOverThreshold));
|
||||||
let shouldMoveOver = overlapPercent > moveOverThreshold;
|
let shouldMoveOver = overlapPercent > moveOverThreshold;
|
||||||
if (logicalForward && shouldMoveOver) {
|
if (logicalForward && shouldMoveOver) {
|
||||||
@@ -2921,44 +3012,21 @@
|
@@ -2921,44 +3015,21 @@
|
||||||
|
|
||||||
// If dragging a group over another group, don't make it look like it is
|
// If dragging a group over another group, don't make it look like it is
|
||||||
// possible to drop the dragged group inside the other group.
|
// possible to drop the dragged group inside the other group.
|
||||||
@@ -559,7 +569,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
// When dragging tab(s) over an ungrouped tab, signal to the user
|
// When dragging tab(s) over an ungrouped tab, signal to the user
|
||||||
// that dropping the tab(s) will create a new tab group.
|
// that dropping the tab(s) will create a new tab group.
|
||||||
shouldCreateGroupOnDrop =
|
shouldCreateGroupOnDrop =
|
||||||
@@ -2968,12 +3036,6 @@
|
@@ -2968,12 +3039,6 @@
|
||||||
overlapPercent > dragOverGroupingThreshold;
|
overlapPercent > dragOverGroupingThreshold;
|
||||||
|
|
||||||
if (shouldCreateGroupOnDrop) {
|
if (shouldCreateGroupOnDrop) {
|
||||||
@@ -572,7 +582,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
} else {
|
} else {
|
||||||
this.removeAttribute("movingtab-createGroup");
|
this.removeAttribute("movingtab-createGroup");
|
||||||
document
|
document
|
||||||
@@ -3000,19 +3062,14 @@
|
@@ -3000,19 +3065,14 @@
|
||||||
dropElement = dropElementGroup;
|
dropElement = dropElementGroup;
|
||||||
colorCode = undefined;
|
colorCode = undefined;
|
||||||
} else if (isTabGroupLabel(dropElement)) {
|
} else if (isTabGroupLabel(dropElement)) {
|
||||||
@@ -600,7 +610,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
}
|
}
|
||||||
this.#setDragOverGroupColor(colorCode);
|
this.#setDragOverGroupColor(colorCode);
|
||||||
this.toggleAttribute("movingtab-ungroup", !colorCode);
|
this.toggleAttribute("movingtab-ungroup", !colorCode);
|
||||||
@@ -3030,19 +3087,28 @@
|
@@ -3030,19 +3090,28 @@
|
||||||
dragData.dropElement = dropElement;
|
dragData.dropElement = dropElement;
|
||||||
dragData.dropBefore = dropBefore;
|
dragData.dropBefore = dropBefore;
|
||||||
dragData.animDropElementIndex = newDropElementIndex;
|
dragData.animDropElementIndex = newDropElementIndex;
|
||||||
@@ -631,7 +641,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
}
|
}
|
||||||
item.style.transform = transform;
|
item.style.transform = transform;
|
||||||
}
|
}
|
||||||
@@ -3095,12 +3161,14 @@
|
@@ -3095,12 +3164,14 @@
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -648,7 +658,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
|
|
||||||
for (let item of this.ariaFocusableItems) {
|
for (let item of this.ariaFocusableItems) {
|
||||||
if (isTabGroupLabel(item)) {
|
if (isTabGroupLabel(item)) {
|
||||||
@@ -3108,6 +3176,18 @@
|
@@ -3108,6 +3179,18 @@
|
||||||
item = item.parentElement;
|
item = item.parentElement;
|
||||||
}
|
}
|
||||||
item.style.transform = "";
|
item.style.transform = "";
|
||||||
@@ -667,7 +677,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
item.removeAttribute("dragover-createGroup");
|
item.removeAttribute("dragover-createGroup");
|
||||||
}
|
}
|
||||||
this.removeAttribute("movingtab-createGroup");
|
this.removeAttribute("movingtab-createGroup");
|
||||||
@@ -3129,16 +3209,15 @@
|
@@ -3129,16 +3212,15 @@
|
||||||
tab.style.left = "";
|
tab.style.left = "";
|
||||||
tab.style.top = "";
|
tab.style.top = "";
|
||||||
tab.style.maxWidth = "";
|
tab.style.maxWidth = "";
|
||||||
@@ -686,7 +696,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
}
|
}
|
||||||
let periphery = draggedTabDocument.getElementById(
|
let periphery = draggedTabDocument.getElementById(
|
||||||
"tabbrowser-arrowscrollbox-periphery"
|
"tabbrowser-arrowscrollbox-periphery"
|
||||||
@@ -3211,7 +3290,7 @@
|
@@ -3211,7 +3293,7 @@
|
||||||
let postTransitionCleanup = () => {
|
let postTransitionCleanup = () => {
|
||||||
movingTab._moveTogetherSelectedTabsData.animate = false;
|
movingTab._moveTogetherSelectedTabsData.animate = false;
|
||||||
};
|
};
|
||||||
@@ -695,7 +705,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
postTransitionCleanup();
|
postTransitionCleanup();
|
||||||
} else {
|
} else {
|
||||||
let onTransitionEnd = transitionendEvent => {
|
let onTransitionEnd = transitionendEvent => {
|
||||||
@@ -3384,7 +3463,7 @@
|
@@ -3384,7 +3466,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
_notifyBackgroundTab(aTab) {
|
_notifyBackgroundTab(aTab) {
|
||||||
@@ -704,7 +714,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3493,7 +3572,10 @@
|
@@ -3493,7 +3575,10 @@
|
||||||
#getDragTarget(event, { ignoreSides = false } = {}) {
|
#getDragTarget(event, { ignoreSides = false } = {}) {
|
||||||
let { target } = event;
|
let { target } = event;
|
||||||
while (target) {
|
while (target) {
|
||||||
@@ -716,7 +726,7 @@ index e2b27db6c13278defea3bcc7606a8da54e7d001c..016d58789918235cc3a41f33ee402c2c
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
target = target.parentNode;
|
target = target.parentNode;
|
||||||
@@ -3510,6 +3592,9 @@
|
@@ -3510,6 +3595,9 @@
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user