From 2031873cb1a7dcb46c4127bc86f2ad9bf4d3b293 Mon Sep 17 00:00:00 2001
From: enahum <nahumhbl@gmail.com>
Date: Tue, 13 Sep 2016 13:00:48 -0300
Subject: PLT-3801 Fix toggle dropdown Main menu (#4014)

---
 webapp/components/sidebar_header.jsx | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

(limited to 'webapp/components/sidebar_header.jsx')

diff --git a/webapp/components/sidebar_header.jsx b/webapp/components/sidebar_header.jsx
index 9a7db54f8..a57a809be 100644
--- a/webapp/components/sidebar_header.jsx
+++ b/webapp/components/sidebar_header.jsx
@@ -1,7 +1,6 @@
 // Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
 // See License.txt for license information.
 
-import $ from 'jquery';
 import NavbarDropdown from './navbar_dropdown.jsx';
 import 'bootstrap';
 
@@ -49,7 +48,13 @@ export default class SidebarHeader extends React.Component {
             this.refs.dropdown.blockToggle = false;
             return;
         }
-        $('.team__header').find('.dropdown-toggle').dropdown('toggle');
+        const menu = document.querySelector('.team__header .dropdown-toggle');
+        const isOpen = menu.parentElement.classList.toggle('open');
+        menu.setAttribute('aria-expanded', isOpen);
+
+        if (!isOpen) {
+            document.querySelector('.sidebar--left .dropdown-menu').scrollTop = 0;
+        }
     }
     render() {
         var me = this.props.currentUser;
@@ -100,6 +105,7 @@ export default class SidebarHeader extends React.Component {
                     teamDisplayName={this.props.teamDisplayName}
                     teamName={this.props.teamName}
                     currentUser={this.props.currentUser}
+                    toggleDropdown={this.toggleDropdown}
                 />
             </div>
         );
-- 
cgit v1.2.3-1-g7c22

