mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 00:50:13 +01:00
🚨
This commit is contained in:
parent
07c7298182
commit
418b934b25
2 changed files with 9 additions and 9 deletions
|
|
@ -575,17 +575,17 @@ export const globalShortcut = (app: App) => {
|
||||||
|
|
||||||
/// #if !BROWSER
|
/// #if !BROWSER
|
||||||
if (matchHotKey("⌘=", event) && !hasClosestByClassName(target, "pdf__outer")) {
|
if (matchHotKey("⌘=", event) && !hasClosestByClassName(target, "pdf__outer")) {
|
||||||
setZoom("zoomIn")
|
setZoom("zoomIn");
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (matchHotKey("⌘0", event)) {
|
if (matchHotKey("⌘0", event)) {
|
||||||
setZoom("restore")
|
setZoom("restore");
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (matchHotKey("⌘-", event) && !hasClosestByClassName(target, "pdf__outer")) {
|
if (matchHotKey("⌘-", event) && !hasClosestByClassName(target, "pdf__outer")) {
|
||||||
setZoom("zoomOut")
|
setZoom("zoomOut");
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -144,7 +144,7 @@ export const initBar = (app: App) => {
|
||||||
icon: "iconZoomIn",
|
icon: "iconZoomIn",
|
||||||
accelerator: "⌘=",
|
accelerator: "⌘=",
|
||||||
click: () => {
|
click: () => {
|
||||||
setZoom("zoomIn")
|
setZoom("zoomIn");
|
||||||
}
|
}
|
||||||
}).element);
|
}).element);
|
||||||
window.siyuan.menus.menu.append(new MenuItem({
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
|
|
@ -152,14 +152,14 @@ export const initBar = (app: App) => {
|
||||||
accelerator: "⌘-",
|
accelerator: "⌘-",
|
||||||
icon: "iconZoomOut",
|
icon: "iconZoomOut",
|
||||||
click: () => {
|
click: () => {
|
||||||
setZoom("zoomOut")
|
setZoom("zoomOut");
|
||||||
}
|
}
|
||||||
}).element);
|
}).element);
|
||||||
window.siyuan.menus.menu.append(new MenuItem({
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
label: window.siyuan.languages.reset,
|
label: window.siyuan.languages.reset,
|
||||||
accelerator: "⌘0",
|
accelerator: "⌘0",
|
||||||
click: () => {
|
click: () => {
|
||||||
setZoom("restore")
|
setZoom("restore");
|
||||||
}
|
}
|
||||||
}).element);
|
}).element);
|
||||||
const rect = target.getBoundingClientRect();
|
const rect = target.getBoundingClientRect();
|
||||||
|
|
@ -202,11 +202,11 @@ export const setZoom = (type: "zoomIn" | "zoomOut" | "restore") => {
|
||||||
barZoomElement.classList.add("fn__none");
|
barZoomElement.classList.add("fn__none");
|
||||||
} else {
|
} else {
|
||||||
if (zoom > 1) {
|
if (zoom > 1) {
|
||||||
barZoomElement.querySelector("use").setAttribute("xlink:href", "#iconZoomIn")
|
barZoomElement.querySelector("use").setAttribute("xlink:href", "#iconZoomIn");
|
||||||
} else {
|
} else {
|
||||||
barZoomElement.querySelector("use").setAttribute("xlink:href", "#iconZoomOut")
|
barZoomElement.querySelector("use").setAttribute("xlink:href", "#iconZoomOut");
|
||||||
}
|
}
|
||||||
barZoomElement.classList.remove("fn__none");
|
barZoomElement.classList.remove("fn__none");
|
||||||
}
|
}
|
||||||
/// #endif
|
/// #endif
|
||||||
}
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue