This commit is contained in:
Baris Soner Usakli
2014-02-20 13:23:29 -05:00
parent 86556989f4
commit 34bf839751
3 changed files with 16 additions and 9 deletions

View File

@@ -15,6 +15,9 @@ var socket,
url: RELATIVE_PATH + '/api/config',
success: function (data) {
config = data;
exposeConfigToTemplates();
if(socket) {
socket.disconnect();
setTimeout(function() {
@@ -591,13 +594,17 @@ var socket,
});
createHeaderTooltips();
templates.setGlobal('relative_path', RELATIVE_PATH);
templates.setGlobal('usePagination', config.usePagination);
templates.setGlobal('topicsPerPage', config.topicsPerPage);
templates.setGlobal('postsPerPage', config.postsPerPage);
});
function exposeConfigToTemplates() {
$(document).ready(function() {
templates.setGlobal('relative_path', RELATIVE_PATH);
for(var key in config) {
templates.setGlobal('config.' + key, config[key]);
}
});
}
function createHeaderTooltips() {
$('#header-menu li i[title]').each(function() {
$(this).parents('a').tooltip({