mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-06 18:04:45 +01:00
Content server book viewer: Show a message when a search finds no matches
This commit is contained in:
parent
4382ae8cbe
commit
b814eae1fd
1 changed files with 8 additions and 0 deletions
|
|
@ -213,9 +213,17 @@ def on_worker_message(self, evt):
|
|||
elif msg.id is self.search_in_flight.id:
|
||||
if msg.type is 'search_complete':
|
||||
self.search_in_flight.id = None
|
||||
if Object.keys(self.result_map).length is 0:
|
||||
self.no_result_received()
|
||||
elif msg.type is 'search_result':
|
||||
self.result_received(msg.result)
|
||||
|
||||
def no_result_received(self):
|
||||
self.show_results()
|
||||
self.results_container.appendChild(E.div(
|
||||
style='margin: 1rem',
|
||||
_('No matching results found')))
|
||||
|
||||
def result_received(self, result):
|
||||
self.show_results()
|
||||
self.result_map[result.result_num] = result
|
||||
|
|
|
|||
Loading…
Reference in a new issue