Browse Source

Display separator between ngFor components (#2359)

We currently remove the separator element when a `box-content-row`
is the last child. However, when we create these rows from ng templates
each row gets a separate template element wrapping it.
This PR tells the cipher-row component whether it is the last child
pull/2368/head
Matt Gibson 4 years ago committed by GitHub
parent
commit
b9fb223dea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      src/popup/components/cipher-row.component.html
  2. 1
      src/popup/components/cipher-row.component.ts
  3. 7
      src/popup/scss/box.scss
  4. 3
      src/popup/vault/ciphers.component.html

1
src/popup/components/cipher-row.component.html

@ -5,6 +5,7 @@ @@ -5,6 +5,7 @@
appStopClick
title="{{ title }} - {{ cipher.name }}"
class="box-content-row box-content-row-flex virtual-scroll-item"
[ngClass]="{ 'override-last': !last }"
>
<div class="row-main">
<app-vault-icon [cipher]="cipher"></app-vault-icon>

1
src/popup/components/cipher-row.component.ts

@ -11,6 +11,7 @@ export class CipherRowComponent { @@ -11,6 +11,7 @@ export class CipherRowComponent {
@Output() launchEvent = new EventEmitter<CipherView>();
@Output() onView = new EventEmitter<CipherView>();
@Input() cipher: CipherView;
@Input() last: boolean;
@Input() showView = false;
@Input() title: string;

7
src/popup/scss/box.scss

@ -211,6 +211,13 @@ @@ -211,6 +211,13 @@
}
}
&.override-last:last-child:before {
border-bottom: 1px solid #000000;
@include themify($themes) {
border-bottom-color: themed("boxBorderColor");
}
}
&.last:last-child:before {
border-bottom: 1px solid #000000;
@include themify($themes) {

3
src/popup/vault/ciphers.component.html

@ -97,8 +97,9 @@ @@ -97,8 +97,9 @@
</h2>
<div class="box-content">
<app-cipher-row
*cdkVirtualFor="let c of ciphers"
*cdkVirtualFor="let c of ciphers; let last = last"
[cipher]="c"
[last]="last"
title="{{ 'viewItem' | i18n }}"
(onSelected)="selectCipher($event)"
(launchEvent)="launchCipher($event)"

Loading…
Cancel
Save