From a715d5f5eae59b91cf8ed32b806507842609180c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 11 Aug 2016 20:42:43 +0530 Subject: [PATCH] Show the overlay when clicking on the top margin --- src/pyj/read_book/view.pyj | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/pyj/read_book/view.pyj b/src/pyj/read_book/view.pyj index f4523eb131..1eb3bec66f 100644 --- a/src/pyj/read_book/view.pyj +++ b/src/pyj/read_book/view.pyj @@ -68,11 +68,17 @@ class View: 'content_loaded': self.on_content_loaded, } self.currently_showing = {} + document.getElementById('book-top-margin').addEventListener('click', self.top_margin_clicked) @property def iframe(self): return document.getElementById(iframe_id) + def top_margin_clicked(self, event): + if event.button is 0: + event.preventDefault(), event.stopPropagation() + self.overlay.show() + def set_margins(self, no_margins): sd = get_session_data() margin_left = 0 if no_margins else sd.get('margin_left')