mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-04-23 11:36:13 +02:00
fix: adjust feature flags, wrong zip usage (#367)
This commit is contained in:
committed by
GitHub
parent
7ae7167fbe
commit
caf8456864
@@ -2,16 +2,16 @@
|
||||
// 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) {
|
||||
document.addEventListener("mousedown", (e) => {
|
||||
if (e.target.hasAttribute("data-tauri-drag-region") && e.buttons === 1) {
|
||||
// prevents text cursor
|
||||
e.preventDefault()
|
||||
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()
|
||||
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)
|
||||
const cmd = e.detail === 2 ? "internal_toggle_maximize" : "start_dragging";
|
||||
window.__TAURI_INVOKE__("plugin:window|" + cmd);
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
window.print = function () {
|
||||
return window.__TAURI_INVOKE__('plugin:window|print')
|
||||
}
|
||||
return window.__TAURI_INVOKE__("plugin:window|print");
|
||||
};
|
||||
|
||||
@@ -2,25 +2,25 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
;(function () {
|
||||
(function () {
|
||||
function toggleDevtoolsHotkey() {
|
||||
const isHotkey = navigator.appVersion.includes('Mac')
|
||||
? event => event.metaKey && event.altKey && event.key === 'I'
|
||||
: event => event.ctrlKey && event.shiftKey && event.key === 'I'
|
||||
const isHotkey = navigator.appVersion.includes("Mac")
|
||||
? (event) => event.metaKey && event.altKey && event.key === "I"
|
||||
: (event) => event.ctrlKey && event.shiftKey && event.key === "I";
|
||||
|
||||
document.addEventListener('keydown', event => {
|
||||
document.addEventListener("keydown", (event) => {
|
||||
if (isHotkey(event)) {
|
||||
window.__TAURI_INVOKE__('plugin:window|internal_toggle_devtools');
|
||||
window.__TAURI_INVOKE__("plugin:window|internal_toggle_devtools");
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
if (
|
||||
document.readyState === 'complete' ||
|
||||
document.readyState === 'interactive'
|
||||
document.readyState === "complete" ||
|
||||
document.readyState === "interactive"
|
||||
) {
|
||||
toggleDevtoolsHotkey()
|
||||
toggleDevtoolsHotkey();
|
||||
} else {
|
||||
window.addEventListener('DOMContentLoaded', toggleDevtoolsHotkey, true)
|
||||
window.addEventListener("DOMContentLoaded", toggleDevtoolsHotkey, true);
|
||||
}
|
||||
})()
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user