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