mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
fixes for extra window
This commit is contained in:
parent
7ea53d468e
commit
907cdd8fcb
@ -30,7 +30,7 @@ export default class DesktopExtraWindowLayout {
|
|||||||
.child(new TitleBarButtonsWidget()))
|
.child(new TitleBarButtonsWidget()))
|
||||||
.child(new FlexContainer('row')
|
.child(new FlexContainer('row')
|
||||||
.collapsible()
|
.collapsible()
|
||||||
.child(new FlexContainer('column').id('center-pane')
|
.child(new FlexContainer('column').id('center-pane').css('flex-grow', '1')
|
||||||
.child(new FlexContainer('row').class('title-row')
|
.child(new FlexContainer('row').class('title-row')
|
||||||
.cssBlock('.title-row > * { margin: 5px; }')
|
.cssBlock('.title-row > * { margin: 5px; }')
|
||||||
.child(new NoteTitleWidget())
|
.child(new NoteTitleWidget())
|
||||||
|
@ -322,6 +322,14 @@ export default class TabManager extends Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
moveTabToNewWindowCommand({tabId}) {
|
||||||
|
const notePath = this.getTabContextById(tabId).notePath;
|
||||||
|
|
||||||
|
this.removeTab(tabId);
|
||||||
|
|
||||||
|
appContext.openInNewWindow(notePath);
|
||||||
|
}
|
||||||
|
|
||||||
async hoistedNoteChangedEvent({hoistedNoteId}) {
|
async hoistedNoteChangedEvent({hoistedNoteId}) {
|
||||||
if (hoistedNoteId === 'root') {
|
if (hoistedNoteId === 'root') {
|
||||||
return;
|
return;
|
||||||
|
@ -56,7 +56,8 @@ class TreeContextMenu {
|
|||||||
const insertNoteAfterEnabled = isNotRoot && !isHoisted && parentNotSearch;
|
const insertNoteAfterEnabled = isNotRoot && !isHoisted && parentNotSearch;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
{ title: 'Open in new tab', command: "openInTab", uiIcon: "empty", enabled: noSelectedNotes },
|
{ title: 'Open in a new tab <kbd>Ctrl+Click</kbd>', command: "openInTab", uiIcon: "empty", enabled: noSelectedNotes },
|
||||||
|
{ title: 'Open in a new window', command: "openInWindow", uiIcon: "empty", enabled: noSelectedNotes },
|
||||||
{ title: 'Insert note after <kbd data-command="createNoteAfter"></kbd>', command: "insertNoteAfter", uiIcon: "plus",
|
{ title: 'Insert note after <kbd data-command="createNoteAfter"></kbd>', command: "insertNoteAfter", uiIcon: "plus",
|
||||||
items: insertNoteAfterEnabled ? this.getNoteTypeItems("insertNoteAfter") : null,
|
items: insertNoteAfterEnabled ? this.getNoteTypeItems("insertNoteAfter") : null,
|
||||||
enabled: insertNoteAfterEnabled && noSelectedNotes },
|
enabled: insertNoteAfterEnabled && noSelectedNotes },
|
||||||
@ -111,6 +112,9 @@ class TreeContextMenu {
|
|||||||
if (command === 'openInTab') {
|
if (command === 'openInTab') {
|
||||||
appContext.tabManager.openTabWithNote(notePath);
|
appContext.tabManager.openTabWithNote(notePath);
|
||||||
}
|
}
|
||||||
|
else if (command === 'openInWindow') {
|
||||||
|
appContext.openInNewWindow(notePath);
|
||||||
|
}
|
||||||
else if (command === "insertNoteAfter") {
|
else if (command === "insertNoteAfter") {
|
||||||
const parentNoteId = this.node.data.parentNoteId;
|
const parentNoteId = this.node.data.parentNoteId;
|
||||||
const isProtected = await treeService.getParentProtectedStatus(this.node);
|
const isProtected = await treeService.getParentProtectedStatus(this.node);
|
||||||
|
@ -258,8 +258,9 @@ export default class TabRowWidget extends BasicWidget {
|
|||||||
x: e.pageX,
|
x: e.pageX,
|
||||||
y: e.pageY,
|
y: e.pageY,
|
||||||
items: [
|
items: [
|
||||||
|
{title: "Move this tab to a new window", command: "moveTabToNewWindow", uiIcon: "empty"},
|
||||||
{title: "Close all tabs", command: "removeAllTabs", uiIcon: "empty"},
|
{title: "Close all tabs", command: "removeAllTabs", uiIcon: "empty"},
|
||||||
{title: "Close all tabs except for this", command: "removeAllTabsExceptForThis", uiIcon: "empty"}
|
{title: "Close all tabs except for this", command: "removeAllTabsExceptForThis", uiIcon: "empty"},
|
||||||
],
|
],
|
||||||
selectMenuItemHandler: ({command}) => {
|
selectMenuItemHandler: ({command}) => {
|
||||||
this.triggerCommand(command, {tabId});
|
this.triggerCommand(command, {tabId});
|
||||||
|
@ -56,6 +56,7 @@ const TPL = `
|
|||||||
overflow: auto;
|
overflow: auto;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
font-family: var(--detail-text-font-family);
|
font-family: var(--detail-text-font-family);
|
||||||
|
padding-left: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.note-detail-text-editor {
|
.note-detail-text-editor {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user