only create a reply box when needed
Previously this led to unnecessary object creation which impacted the rendering time (on my machine 200 comments -> 1200ms) just to create the postbox per comment (just the object initialization)).
This commit is contained in:
parent
cac4694f43
commit
2b7d263735
@ -18,4 +18,4 @@ define(function() {
|
|||||||
return {
|
return {
|
||||||
autoresize: autoresize
|
autoresize: autoresize
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
@ -120,10 +120,10 @@ define(["app/text/html", "app/dom", "app/utils", "app/api", "app/markup", "app/i
|
|||||||
header = $("#isso-" + comment.id + " > .text-wrapper > .isso-comment-header"),
|
header = $("#isso-" + comment.id + " > .text-wrapper > .isso-comment-header"),
|
||||||
text = $("#isso-" + comment.id + " > .text-wrapper > .text");
|
text = $("#isso-" + comment.id + " > .text-wrapper > .text");
|
||||||
|
|
||||||
var form = new Postbox(comment.id);
|
var form = null;
|
||||||
$("a.reply", footer).toggle("click",
|
$("a.reply", footer).toggle("click",
|
||||||
function(toggler) {
|
function(toggler) {
|
||||||
footer.insertAfter(form);
|
form = footer.insertAfter(new Postbox(comment.id));
|
||||||
form.onsuccess = function() { toggler.next(); };
|
form.onsuccess = function() { toggler.next(); };
|
||||||
$("textarea", form).focus();
|
$("textarea", form).focus();
|
||||||
$("a.reply", footer).textContent = msgs["comment-close"];
|
$("a.reply", footer).textContent = msgs["comment-close"];
|
||||||
@ -269,4 +269,4 @@ define(["app/text/html", "app/dom", "app/utils", "app/api", "app/markup", "app/i
|
|||||||
insert: insert,
|
insert: insert,
|
||||||
Postbox: Postbox
|
Postbox: Postbox
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
@ -38,4 +38,4 @@ require(["ready", "app/api", "app/isso", "app/count", "app/dom", "app/markup"],
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user