From 5327ac782034cdaff3980f68ab998b8372d2b4c1 Mon Sep 17 00:00:00 2001 From: Lightforger Date: Fri, 19 Apr 2013 19:45:24 +0300 Subject: [PATCH] display notes only after all are generated Greatly improves load time of pages with a lot of notes (less DOM changes). --- app/assets/javascripts/notes.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/notes.js b/app/assets/javascripts/notes.js index 78eab805e..7e63b3319 100644 --- a/app/assets/javascripts/notes.js +++ b/app/assets/javascripts/notes.js @@ -441,7 +441,8 @@ Danbooru.Note = { left: x, top: y, width: w, - height: h + height: h, + display: 'none' }); $("#note-container").append($note_box); @@ -488,6 +489,12 @@ Danbooru.Note = { $article.html() ); }); + + $('#note-container').css('display','none'); + $('.note-box').each(function(i, v) { + $(v).css('display','block') + }); + $('#note-container').css('display','block'); } }