Skip to content

Commit

Permalink
fix: reset documents on nav correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Yelinz committed Jan 9, 2024
1 parent 85e5dd6 commit 93e7155
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
26 changes: 13 additions & 13 deletions addon/routes/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ export default class ApplicationRoute extends Route {
this.config.activeGroup = transition.to.queryParams.activeGroup;
}

resetController(controller, isExiting) {
// isExiting would be false if only the route's model was changing
if (isExiting) {
controller.setProperties({
category: undefined,
tags: [],
marks: [],
search: undefined,
document: undefined,
activeGroup: undefined,
sort: undefined,
});
}
resetController(controller) {
/* Depending on how ember alexandria is used we might have to reset
the document selection on navigation */
controller.setProperties({
category: undefined,
tags: [],
marks: [],
search: undefined,
document: undefined,
activeGroup: undefined,
sort: undefined,
});
this.documents.selectedDocuments = [];
}
}
4 changes: 2 additions & 2 deletions tests/dummy/app/templates/application.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<div class="uk-navbar-left">
<ul class="uk-navbar-nav">
<li class="uk-active">
<a href="/">
<LinkTo @route="alexandria">
Alexandria
</a>
</LinkTo>
</li>

<li>
Expand Down

0 comments on commit 93e7155

Please sign in to comment.