// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. var Utils = require('../../utils/utils.jsx'); var Client = require('../../utils/client.jsx'); var TeamStore = require('../../stores/team_store.jsx'); var Constants = require('../../utils/constants.jsx'); function getStateFromStores() { return {currentTeam: TeamStore.getCurrent()}; } export default class AdminNavbarDropdown extends React.Component { constructor(props) { super(props); this.blockToggle = false; this.handleLogoutClick = this.handleLogoutClick.bind(this); this.state = getStateFromStores(); } handleLogoutClick(e) { e.preventDefault(); Client.logout(); } componentDidMount() { $(React.findDOMNode(this.refs.dropdown)).on('hide.bs.dropdown', () => { this.blockToggle = true; setTimeout(() => { this.blockToggle = false; }, 100); }); } componentWillUnmount() { $(React.findDOMNode(this.refs.dropdown)).off('hide.bs.dropdown'); } render() { return (
); } }