export multiword example as new entry

This commit is contained in:
matic_t
2020-09-29 04:07:05 -07:00
parent a0758f5c11
commit eea25b9968
5 changed files with 158 additions and 5 deletions

View File

@@ -98,11 +98,16 @@ class View:
elif type(menu_target) is Example:
example = menu_target
sense = example_sense(example, entry)
return h("span.popup-menu", { "style": style }, [
dom_children = [
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)}}, "🗑")])
h("button.shyButton", { "on": {"click": msg(ExampleBin, example)}}, "🗑")]
if example.is_multiword():
dom_children.insert(1, h("button.shyButton", { "on": {"click": msg(ExampleAsNewEntry, example, sense)}}, "As new Entry"))
return h("span.popup-menu", { "style": style }, dom_children)
else:
console.log("Should not be heree!!")