mirror of https://github.com/Chocobozzz/PeerTube
Fix my-feed popover title state
parent
b455a59bfd
commit
f027bdb4b0
|
@ -1,8 +1,8 @@
|
||||||
<button
|
<button
|
||||||
*ngIf="syndicationItems && syndicationItems.length !== 0"
|
*ngIf="syndicationItems && syndicationItems.length !== 0"
|
||||||
|
#popover="ngbPopover"
|
||||||
[ngbPopover]="feedsList" [autoClose]="true" placement="bottom left auto"
|
[ngbPopover]="feedsList" [autoClose]="true" placement="bottom left auto"
|
||||||
class="feed border-0 p-0"
|
class="feed border-0 p-0" [title]="getTitle()"
|
||||||
title="Open syndication dropdown" i18n-title
|
|
||||||
>
|
>
|
||||||
<my-global-icon iconName="syndication"></my-global-icon>
|
<my-global-icon iconName="syndication"></my-global-icon>
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { Component, Input } from '@angular/core'
|
import { NgFor, NgIf } from '@angular/common'
|
||||||
import { Syndication } from './syndication.model'
|
import { Component, Input, ViewChild } from '@angular/core'
|
||||||
import { GlobalIconComponent } from '../../shared-icons/global-icon.component'
|
|
||||||
import { NgbPopover } from '@ng-bootstrap/ng-bootstrap'
|
import { NgbPopover } from '@ng-bootstrap/ng-bootstrap'
|
||||||
import { NgIf, NgFor } from '@angular/common'
|
import { GlobalIconComponent } from '../../shared-icons/global-icon.component'
|
||||||
|
import { Syndication } from './syndication.model'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'my-feed',
|
selector: 'my-feed',
|
||||||
|
@ -12,5 +12,15 @@ import { NgIf, NgFor } from '@angular/common'
|
||||||
imports: [ NgIf, NgbPopover, GlobalIconComponent, NgFor ]
|
imports: [ NgIf, NgbPopover, GlobalIconComponent, NgFor ]
|
||||||
})
|
})
|
||||||
export class FeedComponent {
|
export class FeedComponent {
|
||||||
|
@ViewChild('popover') popover: NgbPopover
|
||||||
|
|
||||||
@Input() syndicationItems: Syndication[]
|
@Input() syndicationItems: Syndication[]
|
||||||
|
|
||||||
|
getTitle () {
|
||||||
|
if (this.popover?.isOpen()) {
|
||||||
|
return $localize`Close syndication dropdown`
|
||||||
|
}
|
||||||
|
|
||||||
|
return $localize`Open syndication dropdown`
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue