Add keyboard shortcuts for focus on current query and go to next output query tab (#1153)

* add go to next output query tab shotcut

* add a new keyboard shortcut for focus on current query

* minor change
This commit is contained in:
Abbie Petchtes
2018-04-13 11:11:25 -07:00
committed by GitHub
parent 9a5f51bfbf
commit 13fb9fdfd2
9 changed files with 86 additions and 2 deletions

View File

@@ -182,7 +182,7 @@ export class PanelComponent extends Disposable implements AfterContentInit, OnIn
if (input instanceof TabComponent) {
tab = input;
} else if (types.isNumber(input)) {
tab = this._tabs[input];
tab = this._tabs.toArray()[input];
} else if (types.isString(input)) {
tab = this._tabs.find(i => i.identifier === input);
}
@@ -226,6 +226,18 @@ export class PanelComponent extends Disposable implements AfterContentInit, OnIn
return this._activeTab.identifier;
}
/**
* Select on the next tab
*/
public selectOnNextTab(): void {
let activeIndex = this._tabs.toArray().findIndex(i => i === this._activeTab);
let nextTabIndex = activeIndex + 1;
if (nextTabIndex === this._tabs.length) {
nextTabIndex = 0;
}
this.selectTab(nextTabIndex);
}
private findAndRemoveTabFromMRU(tab: TabComponent): void {
let mruIndex = this._mru.findIndex(i => i === tab);