Close all open panels when a search result is displayed

This commit is contained in:
Kovid Goyal 2015-12-20 15:23:05 +05:30
parent 944795db53
commit cb91b28566
2 changed files with 7 additions and 1 deletions

View File

@ -121,6 +121,12 @@ class UI:
self.states.pop()
self.apply_state(self.states[-1])
def close_all_panels(self):
if len(self.states) > 1:
while len(self.states) > 1:
self.states.pop()
self.apply_state(self.states[-1])
def replace_panel(self, state):
if len(self.states) > 1:
self.states.pop()

View File

@ -250,7 +250,7 @@ class BooksView:
return error_dialog(_('Could not change search query'), err + '', details=err.stack)
query = {'search':self.interface_data.search_result.query, 'library_id':self.interface_data.library_id}
window.history.pushState(None, '', encode_query(query))
boss.ui.close_panel()
boss.ui.close_all_panels()
self.update_fetching_status()
window.scrollTo(0, 0)
elif end_type != 'abort':