diff --git a/src/pyj/read_book/search.pyj b/src/pyj/read_book/search.pyj new file mode 100644 index 0000000000..9857eeb0b7 --- /dev/null +++ b/src/pyj/read_book/search.pyj @@ -0,0 +1,15 @@ +# vim:fileencoding=utf-8 +# License: GPL v3 Copyright: 2017, Kovid Goyal +from __python__ import hash_literals, bound_methods + +class SearchOverlay: + + def __init__(self, view): + self.view = view + + @property + def container(self): + return document.getElementById('book-search-overlay') + + def hide(self): + self.container.style.display = 'none' diff --git a/src/pyj/read_book/view.pyj b/src/pyj/read_book/view.pyj index a207e6a972..4a5384de0b 100644 --- a/src/pyj/read_book/view.pyj +++ b/src/pyj/read_book/view.pyj @@ -11,6 +11,7 @@ from book_list.globals import get_session_data, get_boss from read_book.globals import messenger, iframe_id, current_book, set_current_spine_item from read_book.resources import load_resources from read_book.overlay import Overlay +from read_book.search import SearchOverlay from read_book.prefs.colors import resolve_color_scheme from read_book.prefs.font_size import change_font_size_by from read_book.touch import set_left_margin_handler, set_right_margin_handler @@ -67,11 +68,13 @@ class View: E.div(style='height:{}px; width:100%; padding: 0'.format(sd.get('margin_bottom', 20)), id='book-bottom-margin'), ), right_margin, - E.div(style='position: absolute; top:0; left:0; width: 100%; height: 100%; display:none', id='book-overlay'), # overlay + E.div(style='position: absolute; top:0; left:0; width: 100%; display:none', id='book-search-overlay'), # search overlay + E.div(style='position: absolute; top:0; left:0; width: 100%; height: 100%; display:none', id='book-overlay'), # main overlay ) ) ) ) + self.search_overlay = SearchOverlay(self) self.overlay = Overlay(self) self.src_doc = None self.iframe_ready = False @@ -121,6 +124,7 @@ class View: change_font_size_by(delta) def show_chrome(self): + self.search_overlay.hide() self.overlay.show() def set_margins(self):