Commit 1470b868 authored by JC Brand's avatar JC Brand

Fix logout

parent 21556832
......@@ -5,7 +5,7 @@
<span class="username w-100 align-self-center">Walter White</span>
<!-- <a class="chatbox-btn fa fa-vcard align-self-center" title="Your profile" data-toggle="modal" data-target="#userProfileModal"></a> -->
<!-- <a class="chatbox-btn fa fa-cog align-self-center" title="Change settings" data-toggle="modal" data-target="#settingsModal"></a> -->
<a class="chatbox-btn fa fa-sign-out align-self-center" title="Log out"></a>
<a class="chatbox-btn logout fa fa-sign-out align-self-center" title="Log out"></a>
</div>
<div class="d-flex xmpp-status">
<span class="online w-100 align-self-center" data-value="online">
......
......@@ -42,7 +42,8 @@
"click a.choose-xmpp-status": "toggleOptions",
"click #fancy-xmpp-status-select a.change-xmpp-status-message": "renderStatusChangeForm",
"submit": "setStatusMessage",
"click .dropdown dd ul li a": "setStatus"
"click .dropdown dd ul li a": "setStatus",
"click .logout": "logOut"
},
initialize () {
......@@ -88,15 +89,18 @@
this.model.setStatusMessage(ev.target.querySelector('input').value);
},
logOut (ev) {
ev.preventDefault();
const result = confirm(__("Are you sure you want to log out?"));
if (result === true) {
_converse.logOut();
}
},
setStatus (ev) {
ev.preventDefault();
const value = ev.target.getAttribute('data-value');
if (value === 'logout') {
_converse.logOut();
} else {
this.model.setStatus(value);
}
utils.slideIn(this.el.querySelector("#target dd ul"));
},
getPrettyStatus (stat) {
......
......@@ -6,7 +6,7 @@
<span class="username w-100 align-self-center">{{{o.fullname}}}</span>
<!-- <a class="chatbox-btn fa fa-vcard align-self-center" title="{{{o.title_your_profile}}}" data-toggle="modal" data-target="#userProfileModal"></a> -->
<!-- <a class="chatbox-btn fa fa-cog align-self-center" title="{{{o.title_change_status}}}" data-toggle="modal" data-target="#settingsModal"></a> -->
<a class="chatbox-btn fa fa-sign-out align-self-center" title="{{{o.title_log_out}}}"></a>
<a class="chatbox-btn logout fa fa-sign-out align-self-center" title="{{{o.title_log_out}}}"></a>
</div>
<div class="d-flex xmpp-status">
<span class="{{{o.chat_status}}} w-100 align-self-center" data-value="{{{o.chat_status}}}">
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment