Add close tabs to the right command
This commit is contained in:
parent
1fc44c783a
commit
c03ab2862b
5 changed files with 17 additions and 0 deletions
|
@ -21,6 +21,18 @@ export default class OperationInteractor {
|
|||
return this.tabPresenter.remove([tab.id]);
|
||||
}
|
||||
|
||||
async closeRight() {
|
||||
let tabs = await this.tabPresenter.getAll();
|
||||
tabs.sort((t1, t2) => t1.index - t2.index);
|
||||
let index = tabs.findIndex(t => t.active);
|
||||
if (index < 0) {
|
||||
return;
|
||||
}
|
||||
for (let i = index + 1; i < tabs.length; ++i) {
|
||||
this.tabPresenter.remove(tabs[i].id);
|
||||
}
|
||||
}
|
||||
|
||||
reopen() {
|
||||
return this.tabPresenter.reopen();
|
||||
}
|
||||
|
|
Reference in a new issue