Example clusters in example edit

This commit is contained in:
2020-01-28 23:06:16 +01:00
parent cab655497b
commit 3f9030f72d
5 changed files with 17 additions and 6 deletions

View File

@@ -27,7 +27,7 @@ class View:
return h("div", {"on": { "click": msg(Reset()) }}, [
View.view_entry(self.model.entry, self.model),
h("button.blk", {"on": { "click": lambda _: check_export(self.model) } }, "CHK"),
View.view_menu(self.model.menu_location, self.model.menu_target),
View.view_menu(self.model.menu_location, self.model.menu_target, self.model.entry),
View.view_modal(self.model.modal_shown, self.model.modal)])
@staticmethod
@@ -174,7 +174,7 @@ class View:
@staticmethod
def view_menu(location, menu_target):
def view_menu(location, menu_target, entry):
style = {
"left": "{}px".format(location[0]),
"top": "{}px".format(location[1])
@@ -201,8 +201,9 @@ class View:
elif type(menu_target) is Example:
example = menu_target
sense = example_sense(example, entry)
return h("span.popup-menu", { "style": style }, [
h("button.shyButton", { "on": {"click": msg(ShowExampleEdit(example))}}, ""),
h("button.shyButton", { "on": {"click": msg(ShowExampleEdit(example, sense))}}, ""),
h("button.shyButton", { "on": {"click": msg(ExampleMoveUp(example))}}, ""),
h("button.shyButton", { "on": {"click": msg(ExampleMoveDown(example))}}, ""),
h("button.shyButton", { "on": {"click": msg(ExampleBin(example))}}, "🗑")])