aboutsummaryrefslogtreecommitdiff
path: root/ext/js/display/display-history.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-10-09 17:06:51 -0400
committerGitHub <noreply@github.com>2021-10-09 17:06:51 -0400
commit0a8992d21550dff1176820d434b5dd7e4f233749 (patch)
tree70f06b7add2971a7bd3c41f5a63327a9040fba3f /ext/js/display/display-history.js
parent0e4b769390ec88e609e862776dff2601227baaa5 (diff)
Search query back button (#1981)
* Always allow history to go back/forward when using browser history * Add a back button which is visible when using the query parser
Diffstat (limited to 'ext/js/display/display-history.js')
-rw-r--r--ext/js/display/display-history.js7
1 files changed, 2 insertions, 5 deletions
diff --git a/ext/js/display/display-history.js b/ext/js/display/display-history.js
index 449bec47..901a2d84 100644
--- a/ext/js/display/display-history.js
+++ b/ext/js/display/display-history.js
@@ -92,11 +92,6 @@ class DisplayHistory extends EventDispatcher {
}
_go(forward) {
- const target = forward ? this._current.next : this._current.previous;
- if (target === null) {
- return false;
- }
-
if (this._useBrowserHistory) {
if (forward) {
history.forward();
@@ -104,6 +99,8 @@ class DisplayHistory extends EventDispatcher {
history.back();
}
} else {
+ const target = forward ? this._current.next : this._current.previous;
+ if (target === null) { return false; }
this._current = target;
this._updateHistoryFromCurrent(true);
}