Merge pull request 'Fixed display for definition - v4.1' (#13) from mt-definition-list-ui into master

Reviewed-on: #13
pull/15/head
matic_t 3 years ago
commit 6da81807df

@ -37,11 +37,20 @@ class Sense(Data):
def view(self, model, sense_num):
examples = [example.view(model, self) for example in self.examples]
definition = ""
indicator = None
explanation = None
for x in self.definitions:
if x["type"] == "indicator":
definition = x.value
break
if indicator is None and x["type"] == "indicator":
indicator = x.value
if explanation is None and x["type"] == "explanation":
explanation = x.value
if indicator:
definition = indicator
if explanation:
definition += ", " + explanation
else:
definition = explanation
result = h("div.elm-div", {}, [
h("div.sense-num", {"on": {"click": M.msg(M.ShowSenseMenu, self)}}, str(sense_num + 1)),

Loading…
Cancel
Save