Chart pinch zoom: only in fullscreen, blocked in normal view via onZoomStart callback
This commit is contained in:
parent
b26264538b
commit
1ad4cd5d1f
1 changed files with 12 additions and 0 deletions
|
|
@ -1453,6 +1453,12 @@ async function showSessionDetail(sessionId) {
|
|||
pinch: { enabled: true },
|
||||
mode: "x",
|
||||
limits: { x: { minRange: 0.5 } },
|
||||
onZoomStart: ({chart, event}) => {
|
||||
// Allow wheel zoom (Ctrl+scroll) always; pinch only in fullscreen
|
||||
if (event && event.type === "wheel") return true;
|
||||
const wrap = chart.canvas.closest(".chart-wrap");
|
||||
return wrap && wrap.classList.contains("chart-full");
|
||||
},
|
||||
},
|
||||
pan: { enabled: false },
|
||||
},
|
||||
|
|
@ -1497,6 +1503,12 @@ async function showSessionDetail(sessionId) {
|
|||
pinch: { enabled: true },
|
||||
mode: "x",
|
||||
limits: { x: { minRange: 0.5 } },
|
||||
onZoomStart: ({chart, event}) => {
|
||||
// Allow wheel zoom (Ctrl+scroll) always; pinch only in fullscreen
|
||||
if (event && event.type === "wheel") return true;
|
||||
const wrap = chart.canvas.closest(".chart-wrap");
|
||||
return wrap && wrap.classList.contains("chart-full");
|
||||
},
|
||||
},
|
||||
pan: { enabled: false },
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue