model.modal now a function and multiple sense labels
This commit is contained in:
@@ -29,20 +29,22 @@ class ShowSenseLabelEdit(GenericShowModal):
|
||||
def update_model(self, model):
|
||||
super().update_model(model)
|
||||
model.sense = self.arg
|
||||
model.modal = modals.edit_sense_label(self.arg)
|
||||
|
||||
model.sense.temporary_labels = model.sense.labels[:]
|
||||
model.modal = lambda: modals.edit_sense_label(model.sense)
|
||||
|
||||
|
||||
class ShowSenseDefinitionEdit(GenericShowModal):
|
||||
def update_model(self, model):
|
||||
super().update_model(model)
|
||||
model.sense = self.arg
|
||||
model.modal = modals.edit_sense_definition(self.arg)
|
||||
model.modal = lambda: modals.edit_sense_definition(self.arg)
|
||||
|
||||
|
||||
class ShowCommentEdit(ClickMessage):
|
||||
def update_model(self, model):
|
||||
model.modal_shown = True
|
||||
model.modal = modals.edit_comment(model.entry.comment)
|
||||
model.modal = lambda: modals.edit_comment(model.entry.comment)
|
||||
|
||||
|
||||
class ShowEditTranslation(GenericShowModal):
|
||||
@@ -57,7 +59,8 @@ class ShowEditTranslation(GenericShowModal):
|
||||
for t in cluster:
|
||||
if t == translation:
|
||||
# fount the one!
|
||||
model.modal = modals.edit_translation(translation, cidx, num_clusters, EditTranslation, (translation, cidx))
|
||||
model.modal = lambda: modals.edit_translation(
|
||||
translation, cidx, num_clusters, EditTranslation, (translation, cidx))
|
||||
return
|
||||
|
||||
console.log("Should not be here!")
|
||||
@@ -70,7 +73,8 @@ class ShowAddTranslation(GenericShowModal):
|
||||
|
||||
for sense in model.entry.senses:
|
||||
if sense == chosen_sense:
|
||||
model.modal = modals.edit_translation(sense, -1, len(sense.translations), AddTranslation, sense)
|
||||
model.modal = lambda: modals.edit_translation(
|
||||
sense, -1, len(sense.translations), AddTranslation, sense)
|
||||
return
|
||||
|
||||
console.log("Should not be here!")
|
||||
|
||||
Reference in New Issue
Block a user