mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 16:40:13 +01:00
This commit is contained in:
parent
364c4b7719
commit
cb58fb0f42
2 changed files with 10 additions and 3 deletions
|
|
@ -428,9 +428,9 @@ export const layoutToJSON = (layout: Layout | Wnd | Tab | Model, json: any) => {
|
||||||
export const resizeDrag = () => {
|
export const resizeDrag = () => {
|
||||||
const dragElement = document.getElementById("drag");
|
const dragElement = document.getElementById("drag");
|
||||||
const width = dragElement.clientWidth;
|
const width = dragElement.clientWidth;
|
||||||
const left = dragElement.getBoundingClientRect().left;
|
const dragRect = dragElement.getBoundingClientRect()
|
||||||
const windowWidth = document.querySelector("#windowControls").clientWidth;
|
const left = dragRect.left;
|
||||||
const right = (windowWidth ? windowWidth : 5) + document.querySelector("#barSearch").clientWidth * 4;
|
const right = window.innerWidth - dragRect.right;
|
||||||
if (left > right && left - right < width) {
|
if (left > right && left - right < width) {
|
||||||
dragElement.style.paddingRight = (left - right) + "px";
|
dragElement.style.paddingRight = (left - right) + "px";
|
||||||
} else if (left < right && right - left < width) {
|
} else if (left < right && right - left < width) {
|
||||||
|
|
|
||||||
|
|
@ -191,6 +191,9 @@ const initBar = () => {
|
||||||
<div id="barSetting" class="toolbar__item b3-tooltips b3-tooltips__sw${window.siyuan.config.readonly ? " fn__none" : ""}" aria-label="${window.siyuan.languages.config} ${updateHotkeyTip(window.siyuan.config.keymap.general.config.custom)}">
|
<div id="barSetting" class="toolbar__item b3-tooltips b3-tooltips__sw${window.siyuan.config.readonly ? " fn__none" : ""}" aria-label="${window.siyuan.languages.config} ${updateHotkeyTip(window.siyuan.config.keymap.general.config.custom)}">
|
||||||
<svg><use xlink:href="#iconSettings"></use></svg>
|
<svg><use xlink:href="#iconSettings"></use></svg>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="barHelp" class="toolbar__item b3-tooltips b3-tooltips__sw" aria-label="${window.siyuan.languages.openBy} ${window.siyuan.languages.help}">
|
||||||
|
<svg><use xlink:href="#iconHelp"></use></svg>
|
||||||
|
</div>
|
||||||
<div class="fn__flex" id="windowControls"></div>`;
|
<div class="fn__flex" id="windowControls"></div>`;
|
||||||
document.querySelector(".toolbar").addEventListener("click", (event: MouseEvent) => {
|
document.querySelector(".toolbar").addEventListener("click", (event: MouseEvent) => {
|
||||||
let target = event.target as HTMLElement;
|
let target = event.target as HTMLElement;
|
||||||
|
|
@ -248,6 +251,10 @@ const initBar = () => {
|
||||||
openSetting();
|
openSetting();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
break;
|
break;
|
||||||
|
} else if (target.id === "barHelp") {
|
||||||
|
mountHelp();
|
||||||
|
event.stopPropagation();
|
||||||
|
break;
|
||||||
} else if (target.id === "toolbarVIP") {
|
} else if (target.id === "toolbarVIP") {
|
||||||
const dialogSetting = openSetting();
|
const dialogSetting = openSetting();
|
||||||
dialogSetting.element.querySelector('.b3-tab-bar [data-name="account"]').dispatchEvent(new CustomEvent("click"));
|
dialogSetting.element.querySelector('.b3-tab-bar [data-name="account"]').dispatchEvent(new CustomEvent("click"));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue