|
@@ -16,7 +16,6 @@ import {hasClosestBlock, hasClosestByAttribute, hasClosestByClassName} from "../
|
|
import {Constants} from "../constants";
|
|
import {Constants} from "../constants";
|
|
/// #if !BROWSER
|
|
/// #if !BROWSER
|
|
import {webFrame, ipcRenderer} from "electron";
|
|
import {webFrame, ipcRenderer} from "electron";
|
|
-import {getCurrentWindow} from "@electron/remote";
|
|
|
|
import {setModelsHash, setTabPosition} from "../window/setHeader";
|
|
import {setModelsHash, setTabPosition} from "../window/setHeader";
|
|
/// #endif
|
|
/// #endif
|
|
import {Search} from "../search";
|
|
import {Search} from "../search";
|
|
@@ -123,17 +122,6 @@ export class Wnd {
|
|
if (window.siyuan.config.fileTree.openFilesUseCurrentTab && target.getAttribute("data-type") === "tab-header") {
|
|
if (window.siyuan.config.fileTree.openFilesUseCurrentTab && target.getAttribute("data-type") === "tab-header") {
|
|
target.classList.remove("item--unupdate");
|
|
target.classList.remove("item--unupdate");
|
|
break;
|
|
break;
|
|
- } else if (target.tagName === "SPAN" && target.className === "fn__flex-1" &&
|
|
|
|
- isWindow() && this.headersElement.getBoundingClientRect().top <= 0) {
|
|
|
|
- /// #if !BROWSER
|
|
|
|
- const currentWindow = getCurrentWindow();
|
|
|
|
- if (currentWindow.isMaximized()) {
|
|
|
|
- currentWindow.unmaximize();
|
|
|
|
- } else {
|
|
|
|
- currentWindow.maximize();
|
|
|
|
- }
|
|
|
|
- /// #endif
|
|
|
|
- break;
|
|
|
|
}
|
|
}
|
|
target = target.parentElement;
|
|
target = target.parentElement;
|
|
}
|
|
}
|
|
@@ -237,7 +225,7 @@ export class Wnd {
|
|
ipcRenderer.send(Constants.SIYUAN_SEND_WINDOWS, {cmd: "closetab", data: tabData.id});
|
|
ipcRenderer.send(Constants.SIYUAN_SEND_WINDOWS, {cmd: "closetab", data: tabData.id});
|
|
it.querySelector("li[data-clone='true']").remove();
|
|
it.querySelector("li[data-clone='true']").remove();
|
|
wnd.switchTab(oldTab.headElement);
|
|
wnd.switchTab(oldTab.headElement);
|
|
- getCurrentWindow().focus();
|
|
|
|
|
|
+ ipcRenderer.send(Constants.SIYUAN_CMD, "focus");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
/// #endif
|
|
/// #endif
|
|
@@ -344,7 +332,7 @@ export class Wnd {
|
|
JSONToCenter(app, tabData, this);
|
|
JSONToCenter(app, tabData, this);
|
|
oldTab = this.children[this.children.length - 1];
|
|
oldTab = this.children[this.children.length - 1];
|
|
ipcRenderer.send(Constants.SIYUAN_SEND_WINDOWS, {cmd: "closetab", data: tabData.id});
|
|
ipcRenderer.send(Constants.SIYUAN_SEND_WINDOWS, {cmd: "closetab", data: tabData.id});
|
|
- getCurrentWindow().focus();
|
|
|
|
|
|
+ ipcRenderer.send(Constants.SIYUAN_CMD, "focus");
|
|
}
|
|
}
|
|
/// #endif
|
|
/// #endif
|
|
if (!oldTab) {
|
|
if (!oldTab) {
|
|
@@ -791,7 +779,7 @@ export class Wnd {
|
|
}
|
|
}
|
|
/// #if !BROWSER
|
|
/// #if !BROWSER
|
|
webFrame.clearCache();
|
|
webFrame.clearCache();
|
|
- getCurrentWindow().webContents.session.clearCache();
|
|
|
|
|
|
+ ipcRenderer.send(Constants.SIYUAN_CMD, "clearCache");
|
|
setTabPosition();
|
|
setTabPosition();
|
|
/// #endif
|
|
/// #endif
|
|
};
|
|
};
|