|
1 | 1 | "use strict"; |
2 | 2 |
|
3 | | -/*globals $, app, utils, socket, templates, config*/ |
| 3 | +/*globals $, app, utils, socket, config*/ |
4 | 4 |
|
5 | 5 | $(document).ready(function () { |
6 | 6 |
|
7 | | - var env = utils.findBootstrapEnvironment(); |
8 | 7 | setupPostReactions(); |
9 | 8 |
|
10 | 9 | function setupPostReactions() { |
@@ -87,21 +86,24 @@ $(document).ready(function () { |
87 | 86 | } |
88 | 87 |
|
89 | 88 | if (reactionEl.length === 0) { |
90 | | - templates.parse('partials/topic/reaction', { |
91 | | - "posts": { |
92 | | - "pid": data.pid, |
93 | | - "reactions": { |
| 89 | + require(['benchpress'], function (Benchpress) { |
| 90 | + Benchpress.parse('partials/topic/reaction', { |
| 91 | + "posts": { |
94 | 92 | "pid": data.pid, |
95 | | - "reaction": data.reaction, |
96 | | - "memberCount": data.reactionCount, |
97 | | - "usernames": data.usernames, |
98 | | - "reacted": (parseInt(data.uid, 10) === app.user.uid), |
99 | | - "reactionImage": data.reactionImage |
| 93 | + "reactions": { |
| 94 | + "pid": data.pid, |
| 95 | + "reaction": data.reaction, |
| 96 | + "memberCount": data.reactionCount, |
| 97 | + "usernames": data.usernames, |
| 98 | + "reacted": (parseInt(data.uid, 10) === app.user.uid), |
| 99 | + "reactionImage": data.reactionImage |
| 100 | + } |
100 | 101 | } |
101 | | - } |
102 | | - }, function (html) { |
103 | | - $('[component="post/reactions"][data-pid="' + data.pid + '"]').append(html); |
| 102 | + }, function (html) { |
| 103 | + $('[component="post/reactions"][data-pid="' + data.pid + '"]').append(html); |
| 104 | + }); |
104 | 105 | }); |
| 106 | + window.templates |
105 | 107 | } else { |
106 | 108 | reactionEl.find(".reaction-emoji-count").attr("data-count", data.reactionCount); |
107 | 109 | reactionEl.attr("data-original-title", data.usernames); |
|
0 commit comments