Skip to content

Commit 2efd92b

Browse files
committed
Revert "WIP: saving my in progress changes [skip ci]" [skip ci]
This reverts commit 9795ed2.
1 parent 870d58e commit 2efd92b

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

isso/js/app/isso.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ var insert = function(comment, scrollIntoView) {
263263
$("a.isso-edit", footer).toggle("click",
264264
function(toggler) {
265265
var edit = $("a.isso-edit", footer);
266+
var avatar = config["avatar"] || config["gravatar"] ? $(".isso-avatar", el, false)[0] : null;
266267

267268
edit.textContent = i18n.translate("comment-save");
268269
edit.insertAfter($.new("a.isso-cancel", i18n.translate("comment-cancel"))).on("click", function() {
@@ -272,12 +273,8 @@ var insert = function(comment, scrollIntoView) {
272273

273274
toggler.canceled = false;
274275
api.view(comment.id, 1).then(function(rv) {
275-
var postbox = $("#isso-" + comment.id).append(new Postbox(comment.id));
276-
console.log(postbox);
276+
var textarea = $.new("textarea.isso-textarea");
277277

278-
postbox.scrollIntoView();
279-
280-
/*
281278
textarea.value = rv.text;
282279
textarea.focus();
283280

@@ -288,11 +285,15 @@ var insert = function(comment, scrollIntoView) {
288285
text.append(textarea);
289286

290287
textarea.scrollIntoView(); // manually scroll the full textbox into view on initial resize
291-
*/
292288
});
289+
290+
if (avatar !== null) {
291+
avatar.hide();
292+
}
293293
},
294294
function(toggler) {
295295
var textarea = $(".isso-textarea", text);
296+
var avatar = config["avatar"] || config["gravatar"] ? $(".isso-avatar", el, false)[0] : null;
296297

297298
if (! toggler.canceled && textarea !== null) {
298299
if (textarea.value.length < 3) {
@@ -312,6 +313,10 @@ var insert = function(comment, scrollIntoView) {
312313
text.classList.remove("isso-textarea-wrapper");
313314
text.classList.add("isso-text");
314315

316+
if (avatar !== null) {
317+
avatar.show();
318+
}
319+
315320
$("a.isso-cancel", footer).remove();
316321
$("a.isso-edit", footer).textContent = i18n.translate("comment-edit");
317322
}

0 commit comments

Comments
 (0)