Files
zulip/static/js/portico/header.js
Brock Whittaker a9a9333b2a portico: Show whether the user is logged in.
This creates a dropdown in place of the normal register/login links
you get when logged out, with an option to go to the app or log out if
that appears you click on the avatar.

A bit more work is needed to make this look really good, but it's a
great start.
2017-10-25 14:59:24 -07:00

17 lines
514 B
JavaScript

$(function () {
$('.portico-header a .logout').on('click', function () {
$('#logout_form').submit();
return false;
});
$("body").click(function (e) {
var $this = $(e.target);
if ($this.is(".dropdown .header-realm-icon") && !$(".dropdown").hasClass("show")) {
$(".dropdown").addClass("show");
} else if (!$this.is(".dropdown ul") && $this.closest(".dropdown ul").length === 0) {
$(".dropdown").removeClass("show");
}
});
});