Merge pull request #4955 from GabrielInTheWorld/hotfixSuperSearch
Hotfix for global search
This commit is contained in:
commit
899eedf403
@ -213,7 +213,9 @@ export class SearchService {
|
|||||||
.filter(model =>
|
.filter(model =>
|
||||||
dedicatedId
|
dedicatedId
|
||||||
? model.id === dedicatedId
|
? model.id === dedicatedId
|
||||||
: model.formatForSearch().searchValue.some(text => text.toLowerCase().indexOf(query) !== -1)
|
: model
|
||||||
|
.formatForSearch()
|
||||||
|
.searchValue.some(text => text && text.toLowerCase().indexOf(query) !== -1)
|
||||||
)
|
)
|
||||||
.sort((a, b) => {
|
.sort((a, b) => {
|
||||||
switch (sortingProperty) {
|
switch (sortingProperty) {
|
||||||
|
@ -304,6 +304,7 @@ export class SuperSearchComponent implements OnInit {
|
|||||||
* @param event KeyboardEvent to listen to keyboard-inputs.
|
* @param event KeyboardEvent to listen to keyboard-inputs.
|
||||||
*/
|
*/
|
||||||
@HostListener('document:keydown', ['$event']) public onKeyNavigation(event: KeyboardEvent): void {
|
@HostListener('document:keydown', ['$event']) public onKeyNavigation(event: KeyboardEvent): void {
|
||||||
|
if (!!this.selectedModel) {
|
||||||
if (event.key === 'Enter') {
|
if (event.key === 'Enter') {
|
||||||
this.viewResult(this.selectedModel);
|
this.viewResult(this.selectedModel);
|
||||||
}
|
}
|
||||||
@ -313,6 +314,7 @@ export class SuperSearchComponent implements OnInit {
|
|||||||
if (event.key === 'ArrowDown') {
|
if (event.key === 'ArrowDown') {
|
||||||
this.selectNextResult(false);
|
this.selectNextResult(false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (event.altKey && event.shiftKey && event.key === 'V') {
|
if (event.altKey && event.shiftKey && event.key === 'V') {
|
||||||
this.showPreview = !this.showPreview;
|
this.showPreview = !this.showPreview;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user