mirror of https://github.com/Chocobozzz/PeerTube
Merge branch 'release/4.0.0' into develop
commit
d1a233d8d8
|
@ -1,7 +1,7 @@
|
||||||
<div class="d-inline-flex position-relative" id="typeahead-container">
|
<div class="d-inline-flex position-relative" id="typeahead-container">
|
||||||
<input
|
<input
|
||||||
type="text" id="search-video" name="search-video" #searchVideo i18n-placeholder placeholder="Search videos, playlists, channels…"
|
type="search" id="search-video" name="search-video" #searchVideo i18n-placeholder placeholder="Search videos, playlists, channels…"
|
||||||
[(ngModel)]="search" (ngModelChange)="onSearchChange()" (keydown)="handleKey($event)" (keydown.enter)="doSearch()"
|
[(ngModel)]="search" (ngModelChange)="onSearchChange()" (keydown)="handleKey($event)"
|
||||||
aria-label="Search" autocomplete="off"
|
aria-label="Search" autocomplete="off"
|
||||||
>
|
>
|
||||||
<my-global-icon
|
<my-global-icon
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
<ul [hidden]="!search || !areSuggestionsOpened" role="listbox" class="p-0 m-0">
|
<ul [hidden]="!search || !areSuggestionsOpened" role="listbox" class="p-0 m-0">
|
||||||
<li
|
<li
|
||||||
*ngFor="let result of results; let i = index" class="suggestion d-flex flex-justify-start flex-items-center p-0 f5"
|
*ngFor="let result of results; let i = index" class="suggestion d-flex flex-justify-start flex-items-center p-0 f5"
|
||||||
role="option" aria-selected="true" (mouseenter)="onSuggestionHover(i)" (click)="onSuggestionlicked(result)"
|
role="option" aria-selected="true" (mouseenter)="onSuggestionHover(i)" (click)="onSuggestionClicked(result)"
|
||||||
>
|
>
|
||||||
<my-suggestion [result]="result" [highlight]="search"></my-suggestion>
|
<my-suggestion [result]="result" [highlight]="search"></my-suggestion>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -152,7 +152,7 @@ export class SearchTypeaheadComponent implements OnInit, AfterViewChecked, OnDes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onSuggestionlicked (payload: SuggestionPayload) {
|
onSuggestionClicked (payload: SuggestionPayload) {
|
||||||
this.doSearch(this.buildSearchTarget(payload))
|
this.doSearch(this.buildSearchTarget(payload))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -170,6 +170,11 @@ export class SearchTypeaheadComponent implements OnInit, AfterViewChecked, OnDes
|
||||||
|
|
||||||
this.keyboardEventsManager.onKeydown(event)
|
this.keyboardEventsManager.onKeydown(event)
|
||||||
break
|
break
|
||||||
|
|
||||||
|
case 'Enter':
|
||||||
|
event.stopPropagation()
|
||||||
|
this.doSearch()
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue