mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
[ACA-1715] Search popup appears when navigating away from search results (#610)
This commit is contained in:
committed by
Denys Vuika
parent
c687c22cc3
commit
f03196d424
@@ -117,13 +117,14 @@ export class SearchInputControlComponent implements OnInit, OnDestroy {
|
|||||||
subscriptAnimationState: string;
|
subscriptAnimationState: string;
|
||||||
noSearchResultTemplate: TemplateRef <any> = null;
|
noSearchResultTemplate: TemplateRef <any> = null;
|
||||||
skipToggle = false;
|
skipToggle = false;
|
||||||
|
toggleDebounceTime = 200;
|
||||||
|
|
||||||
private toggleSearch = new Subject<any>();
|
private toggleSearch = new Subject<any>();
|
||||||
private focusSubject = new Subject<FocusEvent>();
|
private focusSubject = new Subject<FocusEvent>();
|
||||||
|
|
||||||
constructor(private thumbnailService: ThumbnailService) {
|
constructor(private thumbnailService: ThumbnailService) {
|
||||||
|
|
||||||
this.toggleSearch.asObservable().pipe(debounceTime(200)).subscribe(() => {
|
this.toggleSearch.asObservable().pipe(debounceTime(this.toggleDebounceTime)).subscribe(() => {
|
||||||
if (this.expandable && !this.skipToggle) {
|
if (this.expandable && !this.skipToggle) {
|
||||||
this.subscriptAnimationState = this.subscriptAnimationState === 'inactive' ? 'active' : 'inactive';
|
this.subscriptAnimationState = this.subscriptAnimationState === 'inactive' ? 'active' : 'inactive';
|
||||||
|
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
[highlight]="true"
|
[highlight]="true"
|
||||||
(optionClicked)="onItemClicked($event)"
|
(optionClicked)="onItemClicked($event)"
|
||||||
[expandable]="!onSearchResults"
|
[expandable]="!onSearchResults"
|
||||||
[liveSearchEnabled]="!onSearchResults"
|
[liveSearchEnabled]="enableLiveSearch"
|
||||||
(submit)="onSearchSubmit($event)"
|
(submit)="onSearchSubmit($event)"
|
||||||
(searchChange)="onSearchChange($event)">
|
(searchChange)="onSearchChange($event)">
|
||||||
</app-search-input-control>
|
</app-search-input-control>
|
||||||
|
@@ -46,6 +46,7 @@ export class SearchInputComponent implements OnInit {
|
|||||||
hasOneChange = false;
|
hasOneChange = false;
|
||||||
hasNewChange = false;
|
hasNewChange = false;
|
||||||
navigationTimer: any;
|
navigationTimer: any;
|
||||||
|
enableLiveSearch = true;
|
||||||
|
|
||||||
@ViewChild('searchInputControl')
|
@ViewChild('searchInputControl')
|
||||||
searchInputControl: SearchInputControlComponent;
|
searchInputControl: SearchInputControlComponent;
|
||||||
@@ -78,6 +79,7 @@ export class SearchInputComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.searchInputControl) {
|
if (this.searchInputControl) {
|
||||||
|
this.enableLiveSearch = false;
|
||||||
this.searchInputControl.searchTerm = searchedWord;
|
this.searchInputControl.searchTerm = searchedWord;
|
||||||
this.searchInputControl.subscriptAnimationState = 'no-animation';
|
this.searchInputControl.subscriptAnimationState = 'no-animation';
|
||||||
}
|
}
|
||||||
@@ -88,6 +90,12 @@ export class SearchInputComponent implements OnInit {
|
|||||||
this.searchInputControl.searchTerm = '';
|
this.searchInputControl.searchTerm = '';
|
||||||
this.searchInputControl.toggleSearchBar();
|
this.searchInputControl.toggleSearchBar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!this.enableLiveSearch) {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.enableLiveSearch = true;
|
||||||
|
}, this.searchInputControl.toggleDebounceTime + 100);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user