Delete messages now just reset the modal, not the actual values.

pull/1/head
Ozbolt Menegatti 4 years ago
parent 87c310464f
commit b6117cf0f5

@ -1,21 +1,26 @@
from browser import document
from message.message import Message from message.message import Message
from message.simple_messages import NoReset
class DeleteComment(Message): class DeleteComment(NoReset):
def update_model(self, model): def update_model(self, model):
model.entry.comment = "" document.getElementById("modal-question").value = ""
class DeleteVariants(Message): class DeleteVariants(NoReset):
def update_model(self, model): def update_model(self, model):
model.entry.variants = [] for el in document.getElementsByClassName("list-adder-input"):
el.value = ""
class DeleteRelatedEntries(Message): class DeleteRelatedEntries(DeleteVariants):
def update_model(self, model): pass
model.entry.related_entries = []
class DeleteEntryLabels(Message): class DeleteEntryLabels(NoReset):
def update_model(self, model): def update_model(self, model):
model.entry.labels = [] for sel in document.getElementsByClassName("label-value"):
sel.selectedIndex = 0
for inpt in document.getElementsByClassName("label-value-other"):
inpt.value = ""

Loading…
Cancel
Save