Last Read Filter + A lot of bug fixes (#3312)
This commit is contained in:
parent
953d80de1a
commit
6b13db129e
42 changed files with 620 additions and 198 deletions
|
|
@ -11,6 +11,7 @@ import {TranslocoDirective} from "@jsverse/transloco";
|
|||
import {NgTemplateOutlet} from "@angular/common";
|
||||
import {SafeHtmlPipe} from "../../../_pipes/safe-html.pipe";
|
||||
import {filter, fromEvent, tap} from "rxjs";
|
||||
import {AbstractControl, FormControl} from "@angular/forms";
|
||||
|
||||
@Component({
|
||||
selector: 'app-setting-item',
|
||||
|
|
@ -36,6 +37,7 @@ export class SettingItemComponent {
|
|||
@Input() subtitle: string | undefined = undefined;
|
||||
@Input() labelId: string | undefined = undefined;
|
||||
@Input() toggleOnViewClick: boolean = true;
|
||||
@Input() control: AbstractControl<any> | null = null;
|
||||
@Output() editMode = new EventEmitter<boolean>();
|
||||
|
||||
/**
|
||||
|
|
@ -67,6 +69,7 @@ export class SettingItemComponent {
|
|||
.pipe(
|
||||
filter((event: Event) => {
|
||||
if (!this.toggleOnViewClick) return false;
|
||||
if (this.control != null && this.control.invalid) return false;
|
||||
|
||||
const mouseEvent = event as MouseEvent;
|
||||
const selection = window.getSelection();
|
||||
|
|
@ -86,6 +89,7 @@ export class SettingItemComponent {
|
|||
|
||||
if (!this.toggleOnViewClick) return;
|
||||
if (!this.canEdit) return;
|
||||
if (this.control != null && this.control.invalid) return;
|
||||
|
||||
this.isEditMode = !this.isEditMode;
|
||||
this.editMode.emit(this.isEditMode);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue