aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/menu/language-chooser.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-08-09 14:55:06 +0200
committerChocobozzz <me@florianbigard.com>2018-08-09 14:55:06 +0200
commit63347a0ff966c7863e5b7431effa1cb0668df893 (patch)
tree8f89d9b4a73f7157103574c05832eff21e338272 /client/src/app/menu/language-chooser.component.ts
parentb34a444e291c8ec90b4c2c965f7d0d6904d1faa7 (diff)
downloadPeerTube-63347a0ff966c7863e5b7431effa1cb0668df893.tar.gz
PeerTube-63347a0ff966c7863e5b7431effa1cb0668df893.tar.zst
PeerTube-63347a0ff966c7863e5b7431effa1cb0668df893.zip
Migrate to bootstrap 4 and ng-bootstrap
Diffstat (limited to 'client/src/app/menu/language-chooser.component.ts')
-rw-r--r--client/src/app/menu/language-chooser.component.ts16
1 files changed, 6 insertions, 10 deletions
diff --git a/client/src/app/menu/language-chooser.component.ts b/client/src/app/menu/language-chooser.component.ts
index 3de6a129d..45fa73e76 100644
--- a/client/src/app/menu/language-chooser.component.ts
+++ b/client/src/app/menu/language-chooser.component.ts
@@ -1,6 +1,6 @@
1import { Component, ViewChild } from '@angular/core' 1import { Component, ElementRef, ViewChild } from '@angular/core'
2import { ModalDirective } from 'ngx-bootstrap/modal'
3import { I18N_LOCALES } from '../../../../shared' 2import { I18N_LOCALES } from '../../../../shared'
3import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
4 4
5@Component({ 5@Component({
6 selector: 'my-language-chooser', 6 selector: 'my-language-chooser',
@@ -8,21 +8,17 @@ import { I18N_LOCALES } from '../../../../shared'
8 styleUrls: [ './language-chooser.component.scss' ] 8 styleUrls: [ './language-chooser.component.scss' ]
9}) 9})
10export class LanguageChooserComponent { 10export class LanguageChooserComponent {
11 @ViewChild('modal') modal: ModalDirective 11 @ViewChild('modal') modal: ElementRef
12 12
13 languages: { [ id: string ]: string }[] = [] 13 languages: { id: string, label: string }[] = []
14 14
15 constructor () { 15 constructor (private modalService: NgbModal) {
16 this.languages = Object.keys(I18N_LOCALES) 16 this.languages = Object.keys(I18N_LOCALES)
17 .map(k => ({ id: k, label: I18N_LOCALES[k] })) 17 .map(k => ({ id: k, label: I18N_LOCALES[k] }))
18 } 18 }
19 19
20 show () { 20 show () {
21 this.modal.show() 21 this.modalService.open(this.modal)
22 }
23
24 hide () {
25 this.modal.hide()
26 } 22 }
27 23
28 buildLanguageLink (lang: { id: string }) { 24 buildLanguageLink (lang: { id: string }) {