Render all new zephyrs with a single template invocation

(imported from commit 13803e0e96901d129d4aefcd5fde63548deb4dc0)
This commit is contained in:
Keegan McAllister
2012-09-24 17:26:32 -04:00
parent 934e3461df
commit 877954aa55
2 changed files with 5 additions and 4 deletions

View File

@@ -1,4 +1,6 @@
{{! Client-side Mustache template for rendering zephyrs.}}
{{#each zephyrs}}
{{#with this}}
{{#include_bookend}}
<tr><td /><td /><td class="bookend" /></tr>
{{/include_bookend}}
@@ -37,3 +39,5 @@
<div class="zephyr_content">{{{content}}}</div>
</td>
</tr>
{{/with}}
{{/each}}

View File

@@ -655,10 +655,7 @@ function add_to_table(zephyrs, table_name, filter_function) {
prev = zephyr;
});
$.each(zephyrs_to_render, function (index, zephyr) {
var new_tr = $(templates.zephyr(zephyr));
table.append(new_tr);
});
table.append(templates.zephyr({'zephyrs': zephyrs_to_render}));
$.each(zephyrs_to_render, function (index, zephyr) {
register_huddle_onclick(get_zephyr_row(zephyr.id), zephyr.sender_email);