Fixed display for definition - v4.1 #13
|
@ -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…
Reference in New Issue
Block a user