|
154 | 154 | this.animatingOpen = true;
|
155 | 155 | this._animating = true;
|
156 | 156 |
|
157 |
| - const initialX = data.x; |
158 |
| - const initialY = data.y; |
| 157 | + const initialX = data.clientX; |
| 158 | + const initialY = data.clientY; |
159 | 159 | const initialWidth = data.width;
|
160 | 160 | const initialHeight = data.height;
|
161 | 161 |
|
|
597 | 597 | this.openGlance(
|
598 | 598 | {
|
599 | 599 | url: undefined,
|
600 |
| - x: browserRect.width / 2, |
601 |
| - y: browserRect.height / 2, |
| 600 | + ...(gZenUIManager._lastClickPosition || { |
| 601 | + clientX: browserRect.width / 2, |
| 602 | + clientY: browserRect.height / 2, |
| 603 | + }), |
602 | 604 | width: 0,
|
603 | 605 | height: 0,
|
604 | 606 | },
|
|
639 | 641 | .classList.remove('zen-glance-background');
|
640 | 642 | this.#currentParentTab._visuallySelected = false;
|
641 | 643 | this.hideSidebarButtons();
|
| 644 | + if (forSplit) { |
| 645 | + this.finishOpeningGlance(); |
| 646 | + return; |
| 647 | + } |
642 | 648 | if (gReduceMotion || forSplit) {
|
| 649 | + gZenViewSplitter.deactivateCurrentSplitView(); |
643 | 650 | this.finishOpeningGlance();
|
644 | 651 | return;
|
645 | 652 | }
|
|
654 | 661 | type: 'spring',
|
655 | 662 | }
|
656 | 663 | );
|
| 664 | + gZenViewSplitter.deactivateCurrentSplitView(); |
657 | 665 | this.finishOpeningGlance();
|
658 | 666 | }
|
659 | 667 |
|
|
678 | 686 | const rect = event.target.getBoundingClientRect();
|
679 | 687 | const data = {
|
680 | 688 | url: event.target._placesNode.uri,
|
681 |
| - x: rect.left, |
682 |
| - y: rect.top, |
| 689 | + clientX: rect.left, |
| 690 | + clientY: rect.top, |
683 | 691 | width: rect.width,
|
684 | 692 | height: rect.height,
|
685 | 693 | };
|
|
737 | 745 | }
|
738 | 746 | return false;
|
739 | 747 | }
|
| 748 | + |
| 749 | + onSearchSelectCommand(where) { |
| 750 | + if (where !== 'tab') { |
| 751 | + return; |
| 752 | + } |
| 753 | + const currentTab = gBrowser.selectedTab; |
| 754 | + const parentTab = currentTab.owner; |
| 755 | + if (!parentTab) { |
| 756 | + return; |
| 757 | + } |
| 758 | + // Open a new glance if the current tab is a glance tab |
| 759 | + const browserRect = gBrowser.tabbox.getBoundingClientRect(); |
| 760 | + this.openGlance( |
| 761 | + { |
| 762 | + url: undefined, |
| 763 | + ...(gZenUIManager._lastClickPosition || { |
| 764 | + clientX: browserRect.width / 2, |
| 765 | + clientY: browserRect.height / 2, |
| 766 | + }), |
| 767 | + width: 0, |
| 768 | + height: 0, |
| 769 | + }, |
| 770 | + currentTab, |
| 771 | + parentTab |
| 772 | + ); |
| 773 | + } |
740 | 774 | }
|
741 | 775 |
|
742 | 776 | window.gZenGlanceManager = new ZenGlanceManager();
|
|
0 commit comments