mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-21 14:34:06 +01:00
This commit is contained in:
parent
31dbd553a5
commit
6bc968c0e6
5 changed files with 18 additions and 4 deletions
|
|
@ -28,6 +28,14 @@ export const fileTree = {
|
|||
<span class="fn__space"></span>
|
||||
<input class="b3-switch fn__flex-center" id="closeTabsOnStart" type="checkbox"${window.siyuan.config.fileTree.closeTabsOnStart ? " checked" : ""}/>
|
||||
</label>
|
||||
<label class="fn__flex b3-label">
|
||||
<div class="fn__flex-1">
|
||||
${window.siyuan.languages.noSplitScreenWhenOpenTab}
|
||||
<div class="b3-label__text">${window.siyuan.languages.noSplitScreenWhenOpenTabTip}</div>
|
||||
</div>
|
||||
<span class="fn__space"></span>
|
||||
<input class="b3-switch fn__flex-center" id="noSplitScreenWhenOpenTab" type="checkbox"${window.siyuan.config.fileTree.noSplitScreenWhenOpenTab ? " checked" : ""}/>
|
||||
</label>
|
||||
<label class="fn__flex b3-label">
|
||||
<div class="fn__flex-1">
|
||||
${window.siyuan.languages.fileTree18}
|
||||
|
|
@ -138,6 +146,7 @@ export const fileTree = {
|
|||
docCreateSaveBox: (fileTree.element.querySelector("#docCreateSaveBox") as HTMLInputElement).value,
|
||||
openFilesUseCurrentTab: (fileTree.element.querySelector("#openFilesUseCurrentTab") as HTMLInputElement).checked,
|
||||
closeTabsOnStart: (fileTree.element.querySelector("#closeTabsOnStart") as HTMLInputElement).checked,
|
||||
noSplitScreenWhenOpenTab: (fileTree.element.querySelector("#noSplitScreenWhenOpenTab") as HTMLInputElement).checked,
|
||||
allowCreateDeeper: (fileTree.element.querySelector("#allowCreateDeeper") as HTMLInputElement).checked,
|
||||
removeDocWithoutConfirm: (fileTree.element.querySelector("#removeDocWithoutConfirm") as HTMLInputElement).checked,
|
||||
useSingleLineSave: (fileTree.element.querySelector("#useSingleLineSave") as HTMLInputElement).checked,
|
||||
|
|
|
|||
|
|
@ -35,7 +35,8 @@ export const initConfigSearch = (element: HTMLElement, app: App) => {
|
|||
getLang(["selectOpen", "tabLimit", "fileTree", "fileTree2", "fileTree3", "fileTree4", "fileTree5",
|
||||
"fileTree6", "fileTree7", "fileTree8", "fileTree9", "fileTree10", "fileTree12", "fileTree13", "fileTree15",
|
||||
"fileTree16", "fileTree17", "fileTree18", "fileTree19", "fileTree20", "fileTree21", "fileTree22", "fileTree23",
|
||||
"fileTree24", "fileTree25", "recentDocsMaxListCount", "recentDocsMaxListCountTip"]),
|
||||
"fileTree24", "fileTree25", "recentDocsMaxListCount", "recentDocsMaxListCountTip", "noSplitScreenWhenOpenTab",
|
||||
"noSplitScreenWhenOpenTabTip"]),
|
||||
|
||||
// 闪卡
|
||||
getLang(["riffCard", "flashcardNewCardLimit", "flashcardNewCardLimitTip", "flashcardReviewCardLimit",
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ export const openLink = (protyle: IProtyle, aLink: string, event?: MouseEvent, c
|
|||
openByMobile(linkAddress);
|
||||
/// #endif
|
||||
} else {
|
||||
openAsset(protyle.app, linkAddress, pdfParams, "right");
|
||||
openAsset(protyle.app, linkAddress, pdfParams, !window.siyuan.config.fileTree.noSplitScreenWhenOpenTab ? "right" : null);
|
||||
}
|
||||
} else {
|
||||
/// #if !BROWSER
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ export const openGlobalSearch = (app: App, text: string, replace: boolean, searc
|
|||
removed: localData.removed,
|
||||
page: 1
|
||||
},
|
||||
position: (window.siyuan.layout.centerLayout.children.length > 1 || window.innerWidth > 1024) ? "right" : undefined
|
||||
position: (!window.siyuan.config.fileTree.noSplitScreenWhenOpenTab && (window.siyuan.layout.centerLayout.children.length > 1 || window.innerWidth > 1024)) ? "right" : undefined
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -593,7 +593,7 @@ export const genSearch = (app: App, config: Config.IUILayoutTabSearchConfig, ele
|
|||
openFile({
|
||||
app,
|
||||
searchData: config,
|
||||
position: (window.siyuan.layout.centerLayout.children.length > 1 || window.innerWidth > 1024) ? "right" : undefined
|
||||
position: (!window.siyuan.config.fileTree.noSplitScreenWhenOpenTab && (window.siyuan.layout.centerLayout.children.length > 1 || window.innerWidth > 1024)) ? "right" : undefined
|
||||
});
|
||||
if (closeCB) {
|
||||
closeCB();
|
||||
|
|
|
|||
4
app/src/types/config.d.ts
vendored
4
app/src/types/config.d.ts
vendored
|
|
@ -629,6 +629,10 @@ declare namespace Config {
|
|||
* Whether to allow the creation of sub-documents deeper than 7 levels
|
||||
*/
|
||||
allowCreateDeeper: boolean;
|
||||
/**
|
||||
* Don't automatically split the screen when opening search, PDF and other tabs
|
||||
*/
|
||||
noSplitScreenWhenOpenTab: boolean;
|
||||
/**
|
||||
* Whether to automatically locate the currently open document in the document tree
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue