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:
parent
b2b8d1b5d0
commit
0e5bcb8a79
@ -665,8 +665,7 @@
|
|||||||
commenterHex = "anonymous";
|
commenterHex = "anonymous";
|
||||||
}
|
}
|
||||||
|
|
||||||
var newCard = commentsRecurse({
|
var comment = {
|
||||||
"root": [{
|
|
||||||
"commentHex": resp.commentHex,
|
"commentHex": resp.commentHex,
|
||||||
"commenterHex": commenterHex,
|
"commenterHex": commenterHex,
|
||||||
"markdown": markdown,
|
"markdown": markdown,
|
||||||
@ -676,8 +675,13 @@
|
|||||||
"state": "approved",
|
"state": "approved",
|
||||||
"direction": 0,
|
"direction": 0,
|
||||||
"creationDate": new Date(),
|
"creationDate": new Date(),
|
||||||
}],
|
};
|
||||||
}, "root")
|
|
||||||
|
var newCard = commentsRecurse({
|
||||||
|
"root": [comment]
|
||||||
|
}, "root");
|
||||||
|
|
||||||
|
commentsMap[resp.commentHex] = comment;
|
||||||
|
|
||||||
if (id !== "root") {
|
if (id !== "root") {
|
||||||
textareaSuperContainer.replaceWith(newCard);
|
textareaSuperContainer.replaceWith(newCard);
|
||||||
|
Loading…
Reference in New Issue
Block a user