commento.js: fix edit failure after new comment
Since the comment's data is not in commentsMap, the edit dialog does not present the user with any text to edit.
This commit is contained in:
@ -665,19 +665,23 @@
|
|||||||
commenterHex = "anonymous";
|
commenterHex = "anonymous";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var comment = {
|
||||||
|
"commentHex": resp.commentHex,
|
||||||
|
"commenterHex": commenterHex,
|
||||||
|
"markdown": markdown,
|
||||||
|
"html": resp.html,
|
||||||
|
"parentHex": "root",
|
||||||
|
"score": 0,
|
||||||
|
"state": "approved",
|
||||||
|
"direction": 0,
|
||||||
|
"creationDate": new Date(),
|
||||||
|
};
|
||||||
|
|
||||||
var newCard = commentsRecurse({
|
var newCard = commentsRecurse({
|
||||||
"root": [{
|
"root": [comment]
|
||||||
"commentHex": resp.commentHex,
|
}, "root");
|
||||||
"commenterHex": commenterHex,
|
|
||||||
"markdown": markdown,
|
commentsMap[resp.commentHex] = comment;
|
||||||
"html": resp.html,
|
|
||||||
"parentHex": "root",
|
|
||||||
"score": 0,
|
|
||||||
"state": "approved",
|
|
||||||
"direction": 0,
|
|
||||||
"creationDate": new Date(),
|
|
||||||
}],
|
|
||||||
}, "root")
|
|
||||||
|
|
||||||
if (id !== "root") {
|
if (id !== "root") {
|
||||||
textareaSuperContainer.replaceWith(newCard);
|
textareaSuperContainer.replaceWith(newCard);
|
||||||
|
Reference in New Issue
Block a user