diff options
author | Chocobozzz <me@florianbigard.com> | 2018-08-09 14:55:06 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-08-09 14:55:06 +0200 |
commit | 63347a0ff966c7863e5b7431effa1cb0668df893 (patch) | |
tree | 8f89d9b4a73f7157103574c05832eff21e338272 /client/src/app/login/login.component.ts | |
parent | b34a444e291c8ec90b4c2c965f7d0d6904d1faa7 (diff) | |
download | PeerTube-63347a0ff966c7863e5b7431effa1cb0668df893.tar.gz PeerTube-63347a0ff966c7863e5b7431effa1cb0668df893.tar.zst PeerTube-63347a0ff966c7863e5b7431effa1cb0668df893.zip |
Migrate to bootstrap 4 and ng-bootstrap
Diffstat (limited to 'client/src/app/login/login.component.ts')
-rw-r--r-- | client/src/app/login/login.component.ts | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/client/src/app/login/login.component.ts b/client/src/app/login/login.component.ts index 9a68c12fa..8e8822510 100644 --- a/client/src/app/login/login.component.ts +++ b/client/src/app/login/login.component.ts | |||
@@ -2,12 +2,12 @@ import { Component, ElementRef, OnInit, ViewChild } from '@angular/core' | |||
2 | import { RedirectService, ServerService } from '@app/core' | 2 | import { RedirectService, ServerService } from '@app/core' |
3 | import { UserService } from '@app/shared' | 3 | import { UserService } from '@app/shared' |
4 | import { NotificationsService } from 'angular2-notifications' | 4 | import { NotificationsService } from 'angular2-notifications' |
5 | import { ModalDirective } from 'ngx-bootstrap/modal' | ||
6 | import { AuthService } from '../core' | 5 | import { AuthService } from '../core' |
7 | import { FormReactive } from '../shared' | 6 | import { FormReactive } from '../shared' |
8 | import { I18n } from '@ngx-translate/i18n-polyfill' | 7 | import { I18n } from '@ngx-translate/i18n-polyfill' |
9 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | 8 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' |
10 | import { LoginValidatorsService } from '@app/shared/forms/form-validators/login-validators.service' | 9 | import { LoginValidatorsService } from '@app/shared/forms/form-validators/login-validators.service' |
10 | import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap' | ||
11 | 11 | ||
12 | @Component({ | 12 | @Component({ |
13 | selector: 'my-login', | 13 | selector: 'my-login', |
@@ -16,14 +16,17 @@ import { LoginValidatorsService } from '@app/shared/forms/form-validators/login- | |||
16 | }) | 16 | }) |
17 | 17 | ||
18 | export class LoginComponent extends FormReactive implements OnInit { | 18 | export class LoginComponent extends FormReactive implements OnInit { |
19 | @ViewChild('forgotPasswordModal') forgotPasswordModal: ModalDirective | 19 | @ViewChild('forgotPasswordModal') forgotPasswordModal: ElementRef |
20 | @ViewChild('forgotPasswordEmailInput') forgotPasswordEmailInput: ElementRef | 20 | @ViewChild('forgotPasswordEmailInput') forgotPasswordEmailInput: ElementRef |
21 | 21 | ||
22 | error: string = null | 22 | error: string = null |
23 | forgotPasswordEmail = '' | 23 | forgotPasswordEmail = '' |
24 | 24 | ||
25 | private openedForgotPasswordModal: NgbModalRef | ||
26 | |||
25 | constructor ( | 27 | constructor ( |
26 | protected formValidatorService: FormValidatorService, | 28 | protected formValidatorService: FormValidatorService, |
29 | private modalService: NgbModal, | ||
27 | private loginValidatorsService: LoginValidatorsService, | 30 | private loginValidatorsService: LoginValidatorsService, |
28 | private authService: AuthService, | 31 | private authService: AuthService, |
29 | private userService: UserService, | 32 | private userService: UserService, |
@@ -84,10 +87,10 @@ export class LoginComponent extends FormReactive implements OnInit { | |||
84 | } | 87 | } |
85 | 88 | ||
86 | openForgotPasswordModal () { | 89 | openForgotPasswordModal () { |
87 | this.forgotPasswordModal.show() | 90 | this.openedForgotPasswordModal = this.modalService.open(this.forgotPasswordModal) |
88 | } | 91 | } |
89 | 92 | ||
90 | hideForgotPasswordModal () { | 93 | hideForgotPasswordModal () { |
91 | this.forgotPasswordModal.hide() | 94 | this.openedForgotPasswordModal.close() |
92 | } | 95 | } |
93 | } | 96 | } |