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.
|
||||
templates.message = Handlebars.compile($("#template_message").html());
|
||||
templates.subscription = Handlebars.compile($("#template_subscription").html());
|
||||
templates.userinfo_popover_title = Handlebars.compile($("#template_userinfo_popover_title").html());
|
||||
templates.userinfo_popover_content = Handlebars.compile($("#template_userinfo_popover_content").html());
|
||||
$.each(['message', 'subscription', 'userinfo_popover_title', 'userinfo_popover_content'],
|
||||
function (index, name) {
|
||||
templates[name] = Handlebars.compile($('#template_'+name).html());
|
||||
}
|
||||
);
|
||||
|
||||
// This requires that we used Django's {% csrf_token %} somewhere on the page.
|
||||
var csrftoken = $('input[name="csrfmiddlewaretoken"]').attr('value');
|
||||
|
|
Loading…
Reference in New Issue