2 * ================================================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ================================================================================
23 constructor($rootScope, $log, userbarUpdateService) {
24 this.templateUrl = 'app/directives/left-menu/left-menu.tpl.html';
26 this.$rootScope = $rootScope;
28 this.userbarUpdateService = userbarUpdateService;
29 this.link = this._link.bind(this);
42 scope.refreshOnlineUsers = () => {
43 this.userbarUpdateService.setRefreshCount(this.userbarUpdateService.maxCount);
46 scope.toggleSidebar = () => {
47 scope.isOpen = !scope.isOpen;
55 scope.isBrowserInternetExplorer = false;
56 scope.browserName = bowser.name;
58 if (bowser.msie || bowser.msedge) {
59 scope.isBrowserInternetExplorer = true;
61 scope.isBrowserInternetExplorer = false;
66 this.userbarUpdateService.getWidthThresholdLeftMenu().then(function (res) {
67 if (res == null || res.response == null) {
68 log.error('userbarUpdateService: failed to get window width threshold for collapsing left menu; please make sure "window_width_threshold_left_menu" is specified in system.properties file.');
70 var leftMenuCollapseWidthThreshold = parseInt(res.response.windowWidth);
71 if ($(window).width()<leftMenuCollapseWidthThreshold) {
72 scope.toggleSidebar();
75 })['catch'](function (err) {
76 log.error('LeftMenu Controller:: getWidthThresholdLeftMenu() failed: ' + err);
81 this.$rootScope.$on('$stateChangeStart', () => {
86 angular.module('ecompApp').directive('leftMenu', ($rootScope,$log,userbarUpdateService) => new LeftMenu($rootScope,$log,userbarUpdateService));
89 function setContentPos(open) {
91 $("#contentId" ).css( "padding-left", "210px" );
93 $("#contentId" ).css( "padding-left", "50px" );