mirror of
https://github.com/zen-browser/components.git
synced 2025-07-08 17:40:00 +02:00
Fix clientX not consistent on about: pages, use css vars for gridSizes
This commit is contained in:
parent
64128671a8
commit
f29af2b115
1 changed files with 10 additions and 15 deletions
|
@ -477,7 +477,7 @@ var gZenViewSplitter = new (class {
|
||||||
|
|
||||||
const isVertical = event.target.getAttribute('orient') === 'vertical';
|
const isVertical = event.target.getAttribute('orient') === 'vertical';
|
||||||
const dimension = isVertical ? 'widths' : 'heights';
|
const dimension = isVertical ? 'widths' : 'heights';
|
||||||
const clientAxis = isVertical ? 'clientX' : 'clientY';
|
const clientAxis = isVertical ? 'screenX' : 'screenY';
|
||||||
|
|
||||||
const gridIdx = event.target.getAttribute('gridIdx');
|
const gridIdx = event.target.getAttribute('gridIdx');
|
||||||
let prevPosition = event[clientAxis];
|
let prevPosition = event[clientAxis];
|
||||||
|
@ -515,21 +515,16 @@ var gZenViewSplitter = new (class {
|
||||||
|
|
||||||
updateGridSizes() {
|
updateGridSizes() {
|
||||||
const splitData = this._data[this.currentView];
|
const splitData = this._data[this.currentView];
|
||||||
if (splitData.widths.length === 1) {
|
const columnGap = 'var(--zen-split-column-gap)';
|
||||||
this.tabBrowserPanel.style.gridTemplateColumns = '';
|
const rowGap = 'var(--zen-split-row-gap)';
|
||||||
} else {
|
|
||||||
this.tabBrowserPanel.style.gridTemplateColumns = splitData.widths.slice(0, -1).map(
|
|
||||||
(w) => `calc(${w}% - 7px) 7px`
|
|
||||||
).join(' ');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (splitData.heights.length === 1) {
|
this.tabBrowserPanel.style.gridTemplateColumns = splitData.widths.slice(0, -1).map(
|
||||||
this.tabBrowserPanel.style.gridTemplateRows = '';
|
(w) => `calc(${w}% - ${columnGap} * ${splitData.widths.length - 1}/${splitData.widths.length}) ${columnGap}`
|
||||||
} else {
|
).join(' ');
|
||||||
this.tabBrowserPanel.style.gridTemplateRows = splitData.heights.slice(0, -1).map(
|
|
||||||
(h) => `calc(${h}% - 7px) 7px`
|
this.tabBrowserPanel.style.gridTemplateRows = splitData.heights.slice(0, -1).map(
|
||||||
).join(' ');
|
(h) => `calc(${h}% - ${rowGap} * ${splitData.heights.length - 1}/${splitData.heights.length}) ${rowGap}`
|
||||||
}
|
).join(' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue