Vanessa 2024-05-27 22:06:35 +08:00
parent 5fcc56eb55
commit bd426f9eb4
2 changed files with 26 additions and 1 deletions

View file

@ -15,6 +15,7 @@ import {showMessage} from "../dialog/message";
import {App} from "../index";
import {isMobile} from "../util/functions";
import {resize} from "../protyle/util/resize";
import {openFileById} from "../editor/util";
export class BlockPanel {
public element: HTMLElement;
@ -118,6 +119,12 @@ export class BlockPanel {
/// #if !BROWSER
openNewWindowById(this.nodeIds[0]);
/// #endif
} else if (type === "stickTab") {
openFileById({
app: options.app,
id: this.nodeIds[0],
action: this.editors[0].protyle.block.rootID !== this.nodeIds[0] ? [Constants.CB_GET_ALL] : [Constants.CB_GET_CONTEXT],
});
}
event.preventDefault();
event.stopPropagation();
@ -231,7 +238,9 @@ export class BlockPanel {
let openHTML = "";
/// #if !BROWSER
if (this.nodeIds.length === 1) {
openHTML = `<span data-type="open" class="block__icon block__icon--show b3-tooltips b3-tooltips__sw" aria-label="${window.siyuan.languages.openByNewWindow}"><svg><use xlink:href="#iconOpenWindow"></use></svg></span>
openHTML = `<span data-type="stickTab" class="block__icon block__icon--show b3-tooltips b3-tooltips__sw" aria-label="${window.siyuan.languages.openInNewTab}"><svg><use xlink:href="#iconLayoutRight"></use></svg></span>
<span class="fn__space"></span>
<span data-type="open" class="block__icon block__icon--show b3-tooltips b3-tooltips__sw" aria-label="${window.siyuan.languages.openByNewWindow}"><svg><use xlink:href="#iconOpenWindow"></use></svg></span>
<span class="fn__space"></span>`;
}
/// #endif