UI: Ref
This commit is contained in:
parent
db1eb1682f
commit
7acf8de9f8
@ -63,7 +63,7 @@
|
|||||||
<ng-template #searchNotEmpty>
|
<ng-template #searchNotEmpty>
|
||||||
<span>{{ 'notification.no-template-matching' | translate : {template: truncate.transform(searchText, true, 6, '...')} }}</span>
|
<span>{{ 'notification.no-template-matching' | translate : {template: truncate.transform(searchText, true, 6, '...')} }}</span>
|
||||||
<span *ngIf="allowCreate">
|
<span *ngIf="allowCreate">
|
||||||
<a translate (click)="createTemplateBySearchText($event, searchText)">notification.create-new-template</a>
|
<a translate (click)="createTemplateByName($event, searchText)">notification.create-new-template</a>
|
||||||
</span>
|
</span>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -212,23 +212,16 @@ export class TemplateAutocompleteComponent implements ControlValueAccessor, OnIn
|
|||||||
}
|
}
|
||||||
|
|
||||||
createTemplate($event: Event, button: MatButton) {
|
createTemplate($event: Event, button: MatButton) {
|
||||||
if ($event) {
|
$event?.stopPropagation();
|
||||||
$event.stopPropagation();
|
|
||||||
}
|
|
||||||
button._elementRef.nativeElement.blur();
|
button._elementRef.nativeElement.blur();
|
||||||
this.openNotificationTemplateDialog({
|
this.createTemplateByName($event);
|
||||||
isAdd: true,
|
|
||||||
predefinedType: this.notificationTypes
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
createTemplateBySearchText($event: Event, searchText: string) {
|
createTemplateByName($event: Event, name?: string) {
|
||||||
if ($event) {
|
$event?.stopPropagation();
|
||||||
$event.stopPropagation();
|
|
||||||
}
|
|
||||||
this.openNotificationTemplateDialog({
|
this.openNotificationTemplateDialog({
|
||||||
isAdd: true,
|
isAdd: true,
|
||||||
predefinedType: this.notificationTypes,
|
predefinedType: this.notificationTypes,
|
||||||
name: searchText
|
name
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user