mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-04-29 12:06:01 +02:00
feat: add init scripts (#361)
This commit is contained in:
committed by
GitHub
parent
d87b569643
commit
7ae7167fbe
@@ -0,0 +1,17 @@
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
document.addEventListener('mousedown', (e) => {
|
||||
if (e.target.hasAttribute('data-tauri-drag-region') && e.buttons === 1) {
|
||||
// prevents text cursor
|
||||
e.preventDefault()
|
||||
// fix #2549: double click on drag region edge causes content to maximize without window sizing change
|
||||
// https://github.com/tauri-apps/tauri/issues/2549#issuecomment-1250036908
|
||||
e.stopImmediatePropagation()
|
||||
|
||||
// start dragging if the element has a `tauri-drag-region` data attribute and maximize on double-clicking it
|
||||
const cmd = e.detail === 2 ? 'internal_toggle_maximize' : 'start_dragging'
|
||||
window.__TAURI_INVOKE__('plugin:window|' + cmd)
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user