/
githubmirror
/
tabby
Обзор
Документация
Войти
/
githubmirror
/
tabby
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
tabby-web-demo/src/buttonProvider.ts
29 строк
882 B
Eugene Pankov
add tabby-web-demo to the repo
11 июл 2021, 17:00
Не верифицирован
11 июл 2021, 17:00
c105137
Код
Авторство
О чём код?
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ import { Injectable } from '@angular/core' import { ToolbarButtonProvider, ToolbarButton, AppService } from 'tabby-core' import { DemoTerminalTabComponent } from './components/terminalTab.component' /** @hidden */ @Injectable() export class ButtonProvider extends ToolbarButtonProvider { constructor ( private app: AppService, ) { super() this.app.ready$.subscribe(() => { this.app.openNewTab({ type: DemoTerminalTabComponent }) }) } provide (): ToolbarButton[] { return [ { icon: require('./icons/plus.svg'), title: 'New demo terminal', click: () => { this.app.openNewTab({ type: DemoTerminalTabComponent }) }, }, ] } }