Delete messages now just reset the modal, not the actual values.
This commit is contained in:
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):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class DeleteEntryLabels(NoReset):
|
||||||
def update_model(self, model):
|
def update_model(self, model):
|
||||||
model.entry.related_entries = []
|
for sel in document.getElementsByClassName("label-value"):
|
||||||
|
sel.selectedIndex = 0
|
||||||
|
for inpt in document.getElementsByClassName("label-value-other"):
|
||||||
class DeleteEntryLabels(Message):
|
inpt.value = ""
|
||||||
def update_model(self, model):
|
|
||||||
model.entry.labels = []
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user