mirror of https://github.com/zulip/zulip.git
Clean up duplicated code in setup.js
(imported from commit 86566f194497b618dff0be6ea2bc829204d03366)
This commit is contained in:
parent
3e86da67f9
commit
faa7565a75
|
@ -13,10 +13,11 @@ $(function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compile Handlebars templates.
|
// Compile Handlebars templates.
|
||||||
templates.message = Handlebars.compile($("#template_message").html());
|
$.each(['message', 'subscription', 'userinfo_popover_title', 'userinfo_popover_content'],
|
||||||
templates.subscription = Handlebars.compile($("#template_subscription").html());
|
function (index, name) {
|
||||||
templates.userinfo_popover_title = Handlebars.compile($("#template_userinfo_popover_title").html());
|
templates[name] = Handlebars.compile($('#template_'+name).html());
|
||||||
templates.userinfo_popover_content = Handlebars.compile($("#template_userinfo_popover_content").html());
|
}
|
||||||
|
);
|
||||||
|
|
||||||
// This requires that we used Django's {% csrf_token %} somewhere on the page.
|
// This requires that we used Django's {% csrf_token %} somewhere on the page.
|
||||||
var csrftoken = $('input[name="csrfmiddlewaretoken"]').attr('value');
|
var csrftoken = $('input[name="csrfmiddlewaretoken"]').attr('value');
|
||||||
|
|
Loading…
Reference in New Issue