First example of sense menu, maybe will delete later, for testing now.

This commit is contained in:
2020-01-21 20:23:12 +01:00
parent c2c5e94aa7
commit f5842c2536
3 changed files with 17 additions and 4 deletions

View File

@@ -2,7 +2,7 @@ from lib.snabbdom import h, patch
from message import *
import random
from view.utils import *
from model import Translation, Sense
from model import Translation, Sense, Example
from export import export_to_xml
@@ -98,7 +98,7 @@ class View:
example_tag += ".example-chosen"
return h("div.example", {}, [
h("div.example-dot", {}, ""),
h("div.example-dot", {"on": {"click": msg(ShowExampleMenu(example))} }, ""),
h(example_tag, {"on": {"click": msg(ShowExampleEdit(example))} }, [
h("span.example-text", {}, example.text),
h("div.example-translation-list", {}, [
@@ -161,6 +161,12 @@ class View:
h("button.shyButton", { "on": {"click": msg(SenseMoveUp(sense))}}, ""),
h("button.shyButton", { "on": {"click": msg(SenseMoveDown(sense))}}, ""),
h("button.shyButton", { "on": {"click": msg(SenseBin(sense))}}, "🗑")])
elif type(menu_target) is Example:
return h("span.popup-menu", { "style": style }, [
h("button.shyButton", {}, "a"),
h("button.shyButton", {}, "b"),
h("button.shyButton", {}, "🗑")])
else:
console.log("Should not be heree!!")