Show the overlay when clicking on the top margin

This commit is contained in:
Kovid Goyal 2016-08-11 20:42:43 +05:30
parent 202528eda9
commit a715d5f5ea

View File

@ -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')