Skip to content

Commit

Permalink
Enable explorer scrolling by panel cid (#62, #106)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgonggrijp committed Aug 18, 2020
1 parent 5737570 commit 8dd593a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions frontend/src/explorer/explorer-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
isFunction,
sortedIndexBy,
constant,
isString,
} from 'lodash';
import Model from '../core/model';
import View from '../core/view';
Expand Down Expand Up @@ -62,9 +63,11 @@ export default class ExplorerView extends View {
* that the stack is just within the viewport. Otherwise, no animation
* occurs.
* By default scrolls to the rightmost stack.
* @param stack: Optional. The stack to focus on / scroll to.
* @param stack: Optional. The stack, or the cid of a panel, to
* focus on / scroll to.
*/
scroll(stack?: PanelStackView, callback?: any): this {
scroll(stack?: string | PanelStackView, callback?: any): this {
if (isString(stack)) stack = this.stacks[this.rltPanelStack[stack]];
if (!stack) stack = this.getRightMostStack();
stack.getTopPanel().trigger('announceRoute');
const thisLeft = this.$el.scrollLeft();
Expand Down

0 comments on commit 8dd593a

Please sign in to comment.