mirror of
https://github.com/TriliumNext/Notes.git
synced 2026-05-03 18:59:09 -05:00
better back/forward navigation
This commit is contained in:
@@ -138,17 +138,11 @@ export default class Entrypoints extends Component {
|
||||
}
|
||||
|
||||
backInNoteHistoryCommand() {
|
||||
const electron = require('electron');
|
||||
const {webContents} = electron.remote.getCurrentWindow();
|
||||
|
||||
webContents.goBack();
|
||||
window.history.back();
|
||||
}
|
||||
|
||||
forwardInNoteHistoryCommand() {console.log("forward");
|
||||
const electron = require('electron');
|
||||
const {webContents} = electron.remote.getCurrentWindow();
|
||||
|
||||
webContents.goForward();
|
||||
forwardInNoteHistoryCommand() {
|
||||
window.history.forward();
|
||||
}
|
||||
|
||||
async searchForResultsCommand({searchText}) {
|
||||
|
||||
@@ -104,8 +104,8 @@ export default class TabManager extends Component {
|
||||
setCurrentNotePathToHash() {
|
||||
const activeTabContext = this.getActiveTabContext();
|
||||
|
||||
if (activeTabContext
|
||||
&& activeTabContext.notePath !== treeService.getHashValueFromAddress()) {
|
||||
if (window.history.length === 0 // first history entry
|
||||
|| (activeTabContext && activeTabContext.notePath !== treeService.getHashValueFromAddress()[0])) {
|
||||
const url = '#' + (activeTabContext.notePath || "") + "-" + activeTabContext.tabId;
|
||||
|
||||
// using pushState instead of directly modifying document.location because it does not trigger hashchange
|
||||
@@ -117,9 +117,9 @@ export default class TabManager extends Component {
|
||||
// it helps navigating in history if note title is included in the title
|
||||
document.title += " - " + activeTabContext.note.title;
|
||||
}
|
||||
|
||||
this.triggerEvent('activeNoteChanged');
|
||||
}
|
||||
|
||||
this.triggerEvent('activeNoteChanged'); // trigger this even in on popstate event
|
||||
}
|
||||
|
||||
/** @return {TabContext[]} */
|
||||
|
||||
Reference in New Issue
Block a user