|
|
@ -19,10 +19,11 @@ export default class AppPrivateSearchTab extends SliderSuperTab { |
|
|
|
|
|
|
|
|
|
|
|
private peerId = 0; |
|
|
|
private peerId = 0; |
|
|
|
private threadId = 0; |
|
|
|
private threadId = 0; |
|
|
|
|
|
|
|
private query = ''; |
|
|
|
private onDatePick: (timestamp: number) => void; |
|
|
|
private onDatePick: (timestamp: number) => void; |
|
|
|
|
|
|
|
|
|
|
|
onOpenAfterTimeout() { |
|
|
|
onOpenAfterTimeout() { |
|
|
|
this.appSearch.beginSearch(this.peerId, this.threadId); |
|
|
|
this.appSearch.beginSearch(this.peerId, this.threadId, this.query); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected init() { |
|
|
|
protected init() { |
|
|
@ -44,30 +45,27 @@ export default class AppPrivateSearchTab extends SliderSuperTab { |
|
|
|
|
|
|
|
|
|
|
|
open(peerId: number, threadId?: number, onDatePick?: AppPrivateSearchTab['onDatePick'], query?: string) { |
|
|
|
open(peerId: number, threadId?: number, onDatePick?: AppPrivateSearchTab['onDatePick'], query?: string) { |
|
|
|
const ret = super.open(); |
|
|
|
const ret = super.open(); |
|
|
|
if(this.init) { |
|
|
|
|
|
|
|
this.init(); |
|
|
|
|
|
|
|
this.init = null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
query && (this.inputSearch.inputField.value = query); |
|
|
|
if(!this.peerId) { |
|
|
|
|
|
|
|
this.query = query; |
|
|
|
|
|
|
|
this.peerId = peerId; |
|
|
|
|
|
|
|
this.threadId = threadId; |
|
|
|
|
|
|
|
this.onDatePick = onDatePick; |
|
|
|
|
|
|
|
|
|
|
|
if(this.peerId !== 0) { |
|
|
|
this.btnPickDate.classList.toggle('hide', !this.onDatePick); |
|
|
|
this.appSearch.beginSearch(this.peerId, this.threadId); |
|
|
|
if(this.onDatePick) { |
|
|
|
return ret; |
|
|
|
attachClickEvent(this.btnPickDate, () => { |
|
|
|
} |
|
|
|
new PopupDatePicker(new Date(), this.onDatePick).show(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.peerId = peerId; |
|
|
|
query && this.appSearch.searchInput.inputField.setValueSilently(query); |
|
|
|
this.threadId = threadId; |
|
|
|
|
|
|
|
this.onDatePick = onDatePick; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.btnPickDate.classList.toggle('hide', !this.onDatePick); |
|
|
|
appSidebarRight.toggleSidebar(true); |
|
|
|
if(this.onDatePick) { |
|
|
|
} else { |
|
|
|
attachClickEvent(this.btnPickDate, () => { |
|
|
|
this.appSearch.beginSearch(this.peerId, this.threadId, query); |
|
|
|
new PopupDatePicker(new Date(), this.onDatePick).show(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
appSidebarRight.toggleSidebar(true); |
|
|
|
|
|
|
|
return ret; |
|
|
|
return ret; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|