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
@ -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"),
|
||||
text = $("#isso-" + comment.id + " > .text-wrapper > .text");
|
||||
|
||||
var form = new Postbox(comment.id);
|
||||
var form = null;
|
||||
$("a.reply", footer).toggle("click",
|
||||
function(toggler) {
|
||||
footer.insertAfter(form);
|
||||
form = footer.insertAfter(new Postbox(comment.id));
|
||||
form.onsuccess = function() { toggler.next(); };
|
||||
$("textarea", form).focus();
|
||||
$("a.reply", footer).textContent = msgs["comment-close"];
|
||||
|
Loading…
Reference in New Issue
Block a user