mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Content server book viewer: Show a message when a search finds no matches
This commit is contained in:
parent
4382ae8cbe
commit
b814eae1fd
@ -213,9 +213,17 @@ class SearchOverlay:
|
||||
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…
x
Reference in New Issue
Block a user