This commit is contained in:
parent
5fcc56eb55
commit
bd426f9eb4
2 changed files with 26 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -22,6 +22,7 @@ import {openNewWindowById} from "../../window/openNewWindow";
|
|||
import {genImportMenu} from "../../menus/navigation";
|
||||
import {transferBlockRef} from "../../menus/block";
|
||||
import {addEditorToDatabase} from "../render/av/addToDatabase";
|
||||
import {openFileById} from "../../editor/util";
|
||||
|
||||
export const openTitleMenu = (protyle: IProtyle, position: IPosition) => {
|
||||
hideTooltip();
|
||||
|
@ -195,6 +196,21 @@ export const openTitleMenu = (protyle: IProtyle, position: IPosition) => {
|
|||
transferBlockRef(protyle.block.rootID);
|
||||
}
|
||||
window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
|
||||
/// #if !MOBILE
|
||||
if (!protyle.model) {
|
||||
window.siyuan.menus.menu.append(new MenuItem({
|
||||
label: window.siyuan.languages.openInNewTab,
|
||||
icon: "iconLayoutRight",
|
||||
click() {
|
||||
openFileById({
|
||||
app: protyle.app,
|
||||
id: protyle.block.id,
|
||||
action: protyle.block.rootID !== protyle.block.id ? [Constants.CB_GET_ALL] : [Constants.CB_GET_CONTEXT],
|
||||
});
|
||||
}
|
||||
}).element);
|
||||
}
|
||||
/// #endif
|
||||
/// #if !BROWSER
|
||||
window.siyuan.menus.menu.append(new MenuItem({
|
||||
label: window.siyuan.languages.openByNewWindow,
|
||||
|
|
Loading…
Add table
Reference in a new issue