<div #instanceInformation class="instance-information">
<my-instance-about-accordion
+ #instanceAboutAccordion
[displayInstanceName]="false"
(init)="onInstanceAboutAccordionInit($event)" [panels]="instanceInformationPanels"
pluginScope="login" pluginHook="filter:login.instance-about-plugin-panels.create.result"
@ViewChild('forgotPasswordModal', { static: true }) forgotPasswordModal: ElementRef
@ViewChild('otpTokenInput') otpTokenInput: InputTextComponent
+ @ViewChild('instanceAboutAccordion') instanceAboutAccordion: InstanceAboutAccordionComponent
accordion: NgbAccordionDirective
error: string = null
onTermsClick (event: Event, instanceInformation: HTMLElement) {
event.preventDefault()
- if (this.accordion) {
- this.accordion.expand('terms')
+ if (this.instanceAboutAccordion) {
+ this.instanceAboutAccordion.expandTerms()
instanceInformation.scrollIntoView({ behavior: 'smooth' })
}
}
</my-signup-step-title>
<my-instance-about-accordion
+ #instanceAboutAccordion
[displayInstanceName]="false"
(init)="onInstanceAboutAccordionInit($event)" [panels]="instanceInformationPanels"
pluginScope="signup" pluginHook="filter:signup.instance-about-plugin-panels.create.result"
import { AuthService } from '@app/core'
import { HooksService } from '@app/core/plugins/hooks.service'
import { InstanceAboutAccordionComponent } from '@app/shared/shared-instance'
-import { NgbAccordionDirective } from '@ng-bootstrap/ng-bootstrap'
import { UserRegister } from '@shared/models'
import { ServerConfig } from '@shared/models/server'
import { SignupService } from '../shared/signup.service'
})
export class RegisterComponent implements OnInit {
@ViewChild('lastStep') lastStep: CdkStep
-
- accordion: NgbAccordionDirective
+ @ViewChild('instanceAboutAccordion') instanceAboutAccordion: InstanceAboutAccordionComponent
signupError: string
signupSuccess = false
}
onTermsClick () {
- if (this.accordion) this.accordion.toggle('terms')
+ this.instanceAboutAccordion.expandTerms()
}
onCodeOfConductClick () {
- if (this.accordion) this.accordion.toggle('code-of-conduct')
+ this.instanceAboutAccordion.expandCodeOfConduct()
}
onInstanceAboutAccordionInit (instanceAboutAccordion: InstanceAboutAccordionComponent) {
- this.accordion = instanceAboutAccordion.accordion
this.aboutHtml = instanceAboutAccordion.aboutHtml
}
<div *ngIf="displayInstanceShortDescription" class="instance-short-description ellipsis-multiline-3">{{ about?.instance.shortDescription }}</div>
<div ngbAccordion #accordion="ngbAccordion" [closeOthers]="true">
- <div ngbAccordionItem *ngIf="panels.features" id="instance-features">
+ <div ngbAccordionItem="instance-features" *ngIf="panels.features">
<div ngbAccordionHeader>
<button ngbAccordionButton>
<my-global-icon iconName="playlists"></my-global-icon>
</div>
</div>
- <div ngbAccordionItem *ngIf="termsPanel" id="terms">
+ <div ngbAccordionItem="terms" *ngIf="termsPanel">
<div ngbAccordionHeader>
<button ngbAccordionButton>
<my-global-icon iconName="playlists"></my-global-icon>
</div>
</div>
- <div ngbAccordionItem *ngIf="moderationPanel" id="moderation-information">
+ <div ngbAccordionItem="moderation-information" *ngIf="moderationPanel">
<div ngbAccordionHeader>
<button ngbAccordionButton>
<my-global-icon iconName="playlists"></my-global-icon>
</div>
</div>
- <div ngbAccordionItem *ngIf="codeOfConductPanel" id="code-of-conduct">
+ <div ngbAccordionItem="code-of-conduct" *ngIf="codeOfConductPanel">
<div ngbAccordionHeader>
<button ngbAccordionButton>
<my-global-icon iconName="playlists"></my-global-icon>
this.pluginPanels = await this.hookService.wrapObject([], this.pluginScope, this.pluginHook)
}
+ expandTerms () {
+ this.accordion.expand('terms')
+ }
+
+ expandCodeOfConduct () {
+ this.accordion.expand('code-of-conduct')
+ }
+
getAdministratorsPanel () {
if (!this.about) return false
if (!this.panels.administrators) return false