diff --git a/src/map-app/app/presenter/sidebar/base.ts b/src/map-app/app/presenter/sidebar/base.ts index 3de55e08..8bbdc4e4 100644 --- a/src/map-app/app/presenter/sidebar/base.ts +++ b/src/map-app/app/presenter/sidebar/base.ts @@ -3,6 +3,7 @@ import { BasePresenter }from '../base'; import { BaseSidebarView } from '../../view/sidebar/base'; import { SidebarPresenter } from '../sidebar'; import { Initiative } from '../../model/initiative'; +import { canDisplayExpandedSidebar } from '../../../utils'; export interface NavigationCallback { disabled: boolean; @@ -21,8 +22,12 @@ export abstract class BaseSidebarPresenter extends BasePresenter { * If the sidebar wants to do something more than to get its view to refresh when the history * buttons have been used, then it should override this definition with its own. */ - historyButtonsUsed(): void { + historyButtonsUsed(): void { this.view.refresh(false); + + // Show the results pane again, since there have been changes + if (canDisplayExpandedSidebar()) // on smaller screens, wait until user clicks Apply Filters + EventBus.Sidebar.showInitiativeList.pub(); } deselectInitiatives(): void { diff --git a/src/map-app/undo-stack.ts b/src/map-app/undo-stack.ts index 2d9b73dd..a9370a98 100644 --- a/src/map-app/undo-stack.ts +++ b/src/map-app/undo-stack.ts @@ -39,7 +39,10 @@ export class WalkableStack1 { assert(this.storage.length > this.index, "storage should always have the initial state element"); this.index += 1; - this.storage[this.index] = obj; // sets storage.length to index+1 + this.storage[this.index] = obj; + + // remove later items from the stack + this.storage.length = this.index + 1; } // Get the current item in the stack