don't remove root msg box on submit, but clear fields

This commit is contained in:
Martin Zimmermann 2013-09-08 14:17:46 +02:00
parent 449c838be3
commit f1ffe444bc

View File

@ -169,8 +169,6 @@ define(["lib/q", "lib/HTML", "helper/utils", "./api", "./forms", "./logging"], f
console.log(utils.heading()); console.log(utils.heading());
// return;
var rootmsgbox = forms.msgbox({}); var rootmsgbox = forms.msgbox({});
HTML.query("#isso-thread").add("div#isso-root").add(rootmsgbox); HTML.query("#isso-thread").add("div#isso-root").add(rootmsgbox);
rootmsgbox.query("input[type=submit]").addEventListener("click", function(event) { rootmsgbox.query("input[type=submit]").addEventListener("click", function(event) {
@ -181,8 +179,10 @@ define(["lib/q", "lib/HTML", "helper/utils", "./api", "./forms", "./logging"], f
text: rootmsgbox.query("textarea").value, text: rootmsgbox.query("textarea").value,
parent: null }) parent: null })
.then(function(rv) { .then(function(rv) {
// remove box on submit rootmsgbox.query("[name=author]").value = "";
rootmsgbox.remove() rootmsgbox.query("[name=email]").value = "";
rootmsgbox.query("[name=website]").value = "";
rootmsgbox.query("textarea").value = "";
insert(rv); insert(rv);
}) })
event.preventDefault() event.preventDefault()