Skip to content

Node.js based forum software built for the modern web

migrating categories to new partial templating #2230

psychobunny00ff0320605d
diff --git a/public/src/client/category.js b/public/src/client/category.js
index 30bcf629f1..1cc0a9fa02 100644
--- a/public/src/client/category.js
+++ b/public/src/client/category.js
@@ -180,13 +180,11 @@ define('forum/category', ['composer', 'forum/pagination', 'forum/infinitescroll'
Category.onNewTopic = function(topic) {
$(window).trigger('filter:categories.new_topic', topic);
-
- ajaxify.loadTemplate('category', function(categoryTemplate) {
- var html = templates.parse(templates.getBlock(categoryTemplate, 'topics'), {
- privileges: {editable: !!$('.thread-tools').length},
- topics: [topic]
- });
-
+
+ templates.parse('category', 'topics', {
+ privileges: {editable: !!$('.thread-tools').length},
+ topics: [topic]
+ }, function(html) {
translator.translate(html, function(translatedHTML) {
var topic = $(translatedHTML),
container = $('#topics-container'),
@@ -276,9 +274,7 @@ define('forum/category', ['composer', 'forum/pagination', 'forum/infinitescroll'
findInsertionPoint();
- ajaxify.loadTemplate('category', function(categoryTemplate) {
- var html = templates.parse(templates.getBlock(categoryTemplate, 'topics'), data);
-
+ templates.parse('category', 'topics', data, function(html) {
translator.translate(html, function(translatedHTML) {
var container = $('#topics-container'),
html = $(translatedHTML);
@@ -348,4 +344,4 @@ define('forum/category', ['composer', 'forum/pagination', 'forum/infinitescroll'
}
return Category;
-});
+});
\ No newline at end of file