Fixing menu location, now works also in lexonomy

This commit is contained in:
Ozbolt Menegatti 2019-11-13 23:21:02 +01:00
parent daa56ba7ac
commit 70642e0f1a
2 changed files with 3 additions and 3 deletions

View File

@ -16,7 +16,7 @@ class GenericShowModal(ClickMessage):
class ShowMenu(ClickMessage):
def __init__(self, event, translation):
super().__init__(event)
self.menu_location = (event.pageX, event.pageY)
self.menu_location = (event.layerX, event.layerY)
self.translation = translation
def update_model(self, model):

View File

@ -85,8 +85,8 @@ class View:
@staticmethod
def view_menu(location, menu_shown, translation):
style = {
"left": str(location[0]),
"top": str(location[1])
"left": "{}px".format(location[0]),
"top": "{}px".format(location[1])
}
if menu_shown:
style["opacity"] = "1"