mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-17 11:11:04 +01:00
Merge branch 'master' of github.com:psychobunny/node-forum
This commit is contained in:
@@ -5,18 +5,23 @@ define(function() {
|
||||
var categories = null,
|
||||
overlay = null,
|
||||
menuBtn = null,
|
||||
postBtn = null;
|
||||
postBtn = null,
|
||||
initialized = false;
|
||||
|
||||
|
||||
function loadCategories(callback) {
|
||||
if (categories) {
|
||||
displayCategories();
|
||||
callback(true);
|
||||
return;
|
||||
}
|
||||
|
||||
jQuery.getJSON('/api/home', function(data) {
|
||||
categories = data.categories;
|
||||
displayCategories();
|
||||
initialized = true;
|
||||
|
||||
if (callback) {
|
||||
callback(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -65,6 +70,8 @@ define(function() {
|
||||
|
||||
|
||||
mobileMenu.onNavigate = function() {
|
||||
if (initialized == false) return false;
|
||||
|
||||
var cid = templates.get('category_id'),
|
||||
tid = templates.get('topic_id');
|
||||
|
||||
@@ -100,9 +107,11 @@ define(function() {
|
||||
animateIcons();
|
||||
}
|
||||
|
||||
|
||||
loadCategories(displayCategories);
|
||||
mobileMenu.onNavigate();
|
||||
loadCategories(function() {
|
||||
displayCategories();
|
||||
mobileMenu.onNavigate();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
@@ -250,19 +250,22 @@
|
||||
if (data[d] === null) {
|
||||
template = replace(namespace + d, '', template);
|
||||
} else if (data[d].constructor == Array) {
|
||||
namespace += d;
|
||||
namespace += d + '.';
|
||||
|
||||
regex = makeRegex(d),
|
||||
block = getBlock(regex, namespace, template)
|
||||
if (block == null) continue;
|
||||
if (block == null) {
|
||||
namespace = namespace.replace(d + '.', '');
|
||||
continue;
|
||||
}
|
||||
|
||||
var numblocks = data[d].length - 1, i = 0, result = "";
|
||||
|
||||
do {
|
||||
result += parse(data[d][i], namespace + '.', block);
|
||||
result += parse(data[d][i], namespace, block);
|
||||
} while (i++ < numblocks);
|
||||
|
||||
namespace = namespace.replace(d, '');
|
||||
namespace = namespace.replace(d + '.', '');
|
||||
template = setBlock(regex, result, template);
|
||||
} else if (data[d] instanceof Object) {
|
||||
namespace += d + '.';
|
||||
|
||||
Reference in New Issue
Block a user