mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-30 03:32:26 +08:00
Make attachments open in a new tab/browser
This commit is contained in:
parent
a02146df17
commit
d2ee3738a2
@ -32,7 +32,7 @@ export default class AbstractTextTypeWidget extends TypeWidget {
|
|||||||
|
|
||||||
async openImageInCurrentTab($img) {
|
async openImageInCurrentTab($img) {
|
||||||
const { noteId, viewScope } = await this.parseFromImage($img);
|
const { noteId, viewScope } = await this.parseFromImage($img);
|
||||||
|
|
||||||
if (noteId) {
|
if (noteId) {
|
||||||
appContext.tabManager.getActiveContext().setNote(noteId, { viewScope });
|
appContext.tabManager.getActiveContext().setNote(noteId, { viewScope });
|
||||||
} else {
|
} else {
|
||||||
@ -40,8 +40,8 @@ export default class AbstractTextTypeWidget extends TypeWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
openImageInNewTab($img) {
|
async openImageInNewTab($img) {
|
||||||
const { noteId, viewScope } = this.parseFromImage($img);
|
const { noteId, viewScope } = await this.parseFromImage($img);
|
||||||
|
|
||||||
if (noteId) {
|
if (noteId) {
|
||||||
appContext.tabManager.openTabWithNoteWithHoisting(noteId, { viewScope });
|
appContext.tabManager.openTabWithNoteWithHoisting(noteId, { viewScope });
|
||||||
|
@ -111,13 +111,9 @@ async function createMainWindow(app: App) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function configureWebContents(webContents: WebContents, spellcheckEnabled: boolean) {
|
function configureWebContents(webContents: WebContents, spellcheckEnabled: boolean) {
|
||||||
if (!mainWindow) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
remoteMain.enable(webContents);
|
remoteMain.enable(webContents);
|
||||||
|
|
||||||
mainWindow.webContents.setWindowOpenHandler((details) => {
|
webContents.setWindowOpenHandler((details) => {
|
||||||
async function openExternal() {
|
async function openExternal() {
|
||||||
(await import('electron')).shell.openExternal(details.url);
|
(await import('electron')).shell.openExternal(details.url);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user