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 ================================================================================
20 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
21 <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
22 <%@ page isELIgnored="false"%>
23 <%@ page import="org.onap.portalsdk.core.util.SystemProperties"%>
24 <%@ page import="org.onap.portalsdk.core.onboarding.util.PortalApiProperties"%>
25 <%@ page import="org.onap.portalsdk.core.onboarding.util.PortalApiConstants"%>
26 <%@ page import="org.onap.portalsdk.core.domain.MenuData"%>
27 <link rel="stylesheet" type="text/css" href="app/fusion/external/ebz/ebz_header/header.css">
28 <link rel="stylesheet" type="text/css" href="app/fusion/external/ebz/ebz_header/portal_ebz_header.css">
29 <link rel="stylesheet" type="text/css" href="app/fusion/external/ebz/sandbox/styles/style.css" >
32 <script src= "app/fusion/external/ebz/angular_js/angular.js"></script>
33 <script src= "app/fusion/external/ebz/angular_js/angular-route.min.js"></script>
34 <script src= "app/fusion/external/ebz/angular_js/angular-sanitize.js"></script>
35 <script src= "app/fusion/external/ebz/angular_js/angular-cookies.js"></script>
36 <script src= "app/fusion/external/ebz/angular_js/app.js"></script>
37 <script src= "app/fusion/external/ebz/angular_js/gestures.js"></script>
38 <script src="static/js/jquery-1.10.2.js"></script>
39 <script src="app/fusion/scripts/modalService.js"></script>
40 <script src="static/js/jquery.mask.min.js" type="text/javascript"></script>
41 <script src="static/js/jquery-ui.js" type="text/javascript"></script>
42 <script src="app/fusion/external/ebz/sandbox/att-abs-tpls.js" type="text/javascript"></script>
43 <script src="static/fusion/js/att_angular_gridster/ui-gridster-tpls.js"></script>
44 <script src="static/fusion/js/att_angular_gridster/angular-gridster.js"></script>
45 <script src= "app/fusion/external/ebz/angular_js/checklist-model.js"></script>
46 <script type="text/javascript" src="app/fusion/external/lodash/lodash.min.0.10.js"></script>
47 <script src="app/fusion/external/angular-ui/ui-bootstrap-tpls-1.1.2.min.js"></script>
48 <script src="app/fusion/scripts/services/userInfoService.js"></script>
49 <script src="app/fusion/scripts/services/leftMenuService.js"></script>
52 <jsp:include page="/WEB-INF/fusion/jsp/ebz/loginSnippet.html" ></jsp:include>
54 <c:set var="UserName" value="<%= session.getAttribute(\"fullName\")%>" />
55 <c:set var="UserFirstName" value="<%= session.getAttribute(\"first_name\")%>" />
58 String contactUsLink = SystemProperties.getProperty(SystemProperties.CONTACT_US_LINK);
59 String redirectUrl = PortalApiProperties.getProperty(PortalApiConstants.ECOMP_REDIRECT_URL);
60 String portalUrl = redirectUrl.substring(0, redirectUrl.lastIndexOf('/')) + "/process_csp";
61 String getAccessLink = redirectUrl.substring(0, redirectUrl.lastIndexOf('/')) + "/get_access";
63 <c:set var="returnPortalUrl" value="<%=portalUrl%>" />
64 <c:set var="contactUsLink" value="<%=contactUsLink%>" />
65 <c:set var="getAccessLink" value="<%=getAccessLink%>" />
68 z-index:997 !important;
71 .secondaryMenuContainer{
74 .megamenu-tabs .megamenu__item {
77 .megamenu-tabs .megamenu__item span {
84 .submenu-tabs .sub__menu{
88 .top-megamenu .megamenu-tabs ul{
94 <%@include file="/WEB-INF/fusion/jsp/ebz/loginSnippet.html" %>
96 <div style="position: relative; z-index: 999;">
97 <div ng-controller="headerController">
99 <div class="headerContainer" id="headerContainer" ng-cloak ng-show="{{showHeader}}">
100 <div id="megaMenuContainer" class="megaMenuContainer" style="margin-top: 0; overflow: visible;">
103 <!-- Mega Menu parent-tab directive with three models menu-items, active-sub-menu, active-menu -->
104 <div id="topMenu" class="top-megamenu" ng-mouseleave="activeClickSubMenu.x.active=false; activeClickMenu.x.active=false">
105 <div style="float:left;width:100%;"parent-tab menu-items="megaMenuDataObject" active-sub-menu='activeClickSubMenu.x' active-menu='activeClickMenu.x'>
106 <div parentmenu-tabs mega-menu="true" menu-items="megaMenuDataObject" style="height:55px;">
107 <div style="float:left">
108 <li class="megamenu__item" style="line-height:55px;" onclick="returnToPortal()">
109 <img src="app/fusion/external/ebz/images/att_logo.png" class="ATTLogo" ></span>
110 <!-- <a id='returnPortal' class="primaryMenuOptionLink" style="font-weight: 400 !important; font-family: clearview_att_bold !important; font-size: 18px;">ECOMP</a>
111 --> <strong style="font-weight: 400 !important; font-family: clearview_att_bold !important; font-size: 18px;" id='returnPortal' >ECOMP Portal</strong>
113 <div menu-tabs mega-menu="true" tab-name="item.text" menu-item="item" active-menu="activeClickMenu.x"
114 ng-repeat="item in megaMenuDataObject" style="font-size: 18px;" ng-mousedown="loadFavorites()" >
115 <div parentmenu-tabs sub-menu="true" ng-show="activeClickMenu.x.active && item.active" menu-items="activeClickMenu.x.children">
116 <!-- Second level menu -->
118 <div menu-tabs sub-menu="true" tab-name="subItem.text"
119 tab-url="subItem.url" menu-item="subItem"
120 ng-repeat="subItem in activeClickMenu.x.children | orderBy : 'column'" active-menu="activeClickSubMenu.x"
121 sub-item-active="{{subItem.active}}" style="float:left;" aria-label="{{subItem.text}}"
122 ng-mouseenter="submenuLevelAction(subItem.text,subItem.column)"
123 ng-mouseleave="submenuLevelAction(subItem.text,subItem.column)"
124 ng-click="submenuLevelAction(subItem.text,subItem.column)" >
125 <i ng-if="subItem.text=='Favorites'" id="favorite-star"
126 class="icon-star favorites-icon-active">
130 <div class="sub__menu" ng-mouseleave="activeClickSubMenu.x.active=false" >
131 <ul ng-show="activeClickSubMenu.x.active" role="menubar" class="columns">
132 <!-- Third level menu -->
133 <div menu-tabs menu-item="subItem"
135 ng-repeat="subItem in activeClickSubMenu.x.children | orderBy : 'column'"
136 ng-show="activeClickSubMenu.x.active">
138 <i id="favorite-selector-third-level"
139 ng-show="isUrlFavorite(subItem.menuId)==false"
140 class="icon-star favorites-icon-inactive"
141 ng-if="subItem.url.length > 1">
143 <i id="favorite-selector-third-level"
144 ng-show="isUrlFavorite(subItem.menuId)"
145 class="icon-star favorites-icon-active"
146 ng-if="subItem.url.length > 1">
148 <span class="title" aria-label="{{subItem.text}}"
149 ng-click="goToUrl(subItem)">{{subItem.text}}</span>
150 <!-- Fourth level menus -->
151 <div att-links-list="">
152 <i id="favorite-selector-fourth-level"
153 class="icon-star favorites-icon-inactive"
154 ng-show="isUrlFavorite(tabValue.menuId)==false"
155 ng-if="tabValue.url.length > 1">
158 <i id="favorite-selector-fourth-level"
159 class="icon-star favorites-icon-active"
160 ng-show="isUrlFavorite(tabValue.menuId)"
161 ng-if="tabValue.url.length > 1">
164 <span role="menuitem" att-links-list-item=""
165 ng-repeat="tabValue in subItem.children"
166 ng-click="goToUrl(tabValue)"
167 att-accessibility-click="13,32"
168 ng-class="{'disabled': tabValue.disabled}">{{tabValue.text}}</span>
170 <hr ng-show="!$last"/>
174 <!-- Favorites level menu -->
175 <div class="favorites-window" ng-show='favoritesWindow' ng-mouseleave="hideFavoritesWindow()">
176 <div id="favorites-menu-items" ng-show="showFavorites">
177 <div ng-repeat="subItem in favoritesMenuItems" att-links-list="" style='display: inline'>
178 <i id="favorite-selector-favorites-list" class="icon-star favorites-icon-active">
180 <a id="favorites-list" aria-label="{{subItem.text}}"
181 ng-click="goToUrl(subItem)"
182 style="margin-left: 3px; margin-right: 20px; text-decoration: none; color: #666666;">
188 <p style='font-weight: 400; font-family: clearview_att_bold !important;
189 font-size: 18px; text-align: center; background-color: lightgray;
190 width: 400px; margin-left: 25%; margin-right: 25%;'>
191 Manage favorites on ECOMP Portal.
195 <!-- Favorites when empty -->
196 <div id="favorites-empty" ng-show='favoritesWindow' ng-show="emptyFavorites">
197 <div id="favorites-empty" ng-show="emptyFavorites" class="favorites-window-empty">
199 <img src="app/fusion/external/ebz/images/no_favorites_star.png">
200 <p class='favoritesLargeText'>No Favorites</p>
201 <p class='favoritesNormalText'>Manage favorites on ECOMP Portal.</p>
211 <li class="megamenu__item" style="line-height:55px;" ng-if="loadMenufail">
212 <strong style="font-weight: 400 !important; font-family: clearview_att_bold !important; font-size: 18px;" >Unable to load menus</strong>
214 <!-- <li class="megamenu__item" style="width: 20%;"> </li>
216 <!-- Login Snippet-->
217 <div style="float:right">
218 <li id="bcLoginSnippet" class="megamenu__item" style="width: 140px;" >
219 <div popover="loginSnippet.html" aria-label="Login Snippet" referby="loginSnippet" att-accessibility-click="13,32" popover-style="\" popover-placement="below" style="width: 200px;">
220 <div class="icon-user-small login-snippet-icon"></div>
221 <div class="login-snippet-text" style="display: inline-block; font-size:12px; margin-left:5px;overflow: hidden; max-height: 31px; max-width:120px; padding-top: 0px; margin-top: 0px; white-space: nowrap;" ng-bind="userProfile.firstName"></div>
224 <li class="megamenu__item" style="width:120px;"> </li>
229 <div style="clear: both"></div>
234 <div class="license-notification" id="license-notification">
235 <a href="javascript:void(0)" style="background-color:#bbb;" class="button button--small" tooltip="Please contact ECOMP Portal team to get the license" tooltip-placement="below" tooltip-style="light" tooltip-popup-delay="500" >
236 <span style="">{{app_name_full}}</span>
239 <div style="position: relative; color: black; top: 70px;">
241 <span ng-style="adjustHLeftMenu('burgerIcon')" style="z-index:998; position:fixed; left:0%; font-size:35px; margin-left:10px;text-decoration:none;">
242 <a ng-click="toggleDrawer();isOpen = !isOpen" href="javascript:void(0);" class="arrow-icon-left" >
243 <span class="icon-hamburger"></span></a>
244 <span ng-init="isOpen = true" ng-show="isOpen" style="font-size:16px; position:relative; top:-8px; left:-15px;">    {{app_name}}</span>
246 <div att-drawer drawer-slide="left" drawer-custom-top="{{drawer_custom_top}}px" drawer-size="200px" drawer-open="drawerOpen" drawer-custom-height="100%" >
247 <div ng-style="adjustHLeftMenu('leftMenu')">
248 <div class="attDrawer" style="margin-top:{{drawer_margin_top}}px;">
249 <div style="margin-left:10px; margin-right:10px;">
250 <accordion close-others="true" css="att-accordion--no-box">
251 <accordion-group ng-repeat="parent in menuItems" heading="{{parent.parentLabel}}" child="{{parent.parentAction}}" parent-link="{{parent.parentAction}}" image-source="{{parent.parentImageSrc}}" child-length="{{parent.childItemList.length}}" is-open="parent.open">
252 <div ng-repeat="subMenu in parent.childItemList" style="font-size:12px; margin-left:10px;">
253 <a href="{{subMenu.action}}" style="font-size:12px; color:#666666;" >{{subMenu.label}}</a>
266 function returnToPortal(){
267 window.location.href = "<c:out value='${returnPortalUrl}'/>";
269 detectScrollEvent = function() {
270 var footerOff = $('#footerContainer').offset().top;
271 var headOff = $('#headerContainer').offset().top;
272 var winHeight = $(window).height();
273 if ((footerOff - headOff) <= winHeight) {
274 $('.att-drawer').css({
275 "height" : footerOff - headOff - 55
278 $('.att-drawer').css({
283 $(window).scroll(function() {
284 if ($('.att-drawer').is(':visible')) {
288 app.controller("headerController", function($scope, $timeout, $log, $http, UserInfoService, $window, $cookies,LeftMenuService) {
289 // $log.debug('HeaderController started');
290 $scope.jsonMenuData = [];
291 $scope.loadMenufail=false;
292 $scope.app_name = "";
293 $scope.app_name_full = "";
294 $scope.megaMenuDataObject =[];
295 $scope.activeClickSubMenu = {
298 $scope.activeClickMenu = {
301 $scope.favoritesMenuItems = [];
302 $scope.favoriteItemsCount = 0;
303 $scope.showFavorites = false;
304 $scope.emptyFavorites = false;
305 $scope.favoritesWindow = false;
312 /*Put user info into fields*/
313 $scope.inputUserInfo = function(userInfo){
314 if (typeof(userInfo) != "undefined" && userInfo!=null && userInfo!=''){
315 if (typeof(userInfo.USER_FIRST_NAME) != "undefined" && userInfo.USER_FIRST_NAME!=null && userInfo.USER_FIRST_NAME!='')
316 $scope.userProfile.firstName = userInfo.USER_FIRST_NAME;
317 if (typeof(userInfo.USER_LAST_NAME) != "undefined" && userInfo.USER_LAST_NAME!=null && userInfo.USER_LAST_NAME!='')
318 $scope.userProfile.lastName = userInfo.USER_LAST_NAME;
319 if (typeof(userInfo.USER_EMAIL) != "undefined" && userInfo.USER_EMAIL!=null && userInfo.USER_EMAIL!='')
320 $scope.userProfile.email = userInfo.USER_EMAIL;
323 /*getting user info from session*/
324 $scope.getUserNameFromSession = function(){
325 UserInfoService.getFunctionalMenuStaticDetailSession()
326 .then(function (res) {
327 $scope.userProfile.firstName = res.firstName;
328 $scope.redirectUrl = res.portalUrl;
331 $scope.getTopMenuStaticInfo=function() {
332 var promise = UserInfoService.getFunctionalMenuStaticDetailShareContext();
335 if(res==null || res==''){
336 $log.info('failed getting static User information');
337 $scope.getUserNameFromSession();
339 $log.info('Received static User information');
341 $scope.inputUserInfo(resData);
342 $scope.userProfile.fullName = $scope.userProfile.firstName+ ' '+ $scope.userProfile.lastName;
346 $log.info('failed getting static User information');
351 var unflatten = function( array, parent, tree ){
352 tree = typeof tree !== 'undefined' ? tree : [];
353 parent = typeof parent !== 'undefined' ? parent : { menuId: null };
354 var children = _.filter( array, function(child){ return child.parentMenuId == parent.menuId; });
356 if( !_.isEmpty( children ) ){
357 if( parent.menuId === null ){
360 parent['children'] = children
362 _.each( children, function( child ){ unflatten( array, child ) } );
368 var menuStructureConvert = function(menuItems) {
369 var megaMenuDataObjectTemp = [
378 url:"<c:out value='${contactUsLink}'/>"
382 url:"<c:out value='${getAccessLink}'/>"
386 return megaMenuDataObjectTemp;
391 LeftMenuService.getAppName().then(function(response){
394 if(j && j !== "null" && j!== "undefined"){
395 // console.log("app name is " + $scope.app_name);
396 $scope.app_name_full = j.data;
397 var processed_app_name = j.data;
398 var indexOfLic = processed_app_name.indexOf('[');
400 if (jQuery('.license-notification')!=null)
401 jQuery('.license-notification').css("display", "none");
403 var n = processed_app_name.length;
407 if(n > indexOfLic && indexOfLic > 0) {
410 $scope.app_name_full = $scope.app_name_full.substr(0, n);
411 $scope.app_name = processed_app_name.substr(0, n);
414 throw "Get app_name response is not an object/is empty";
417 console.log("error happened while trying to get app name "+e);
421 console.log('getAppName failed', error);
425 $scope.getTopMenuStaticInfo();
426 $scope.getMenu=function() {
430 url: 'get_functional_menu',
431 // TIMEOUT USED FOR LOCAL TESTING ONLY
433 }).success(function (response) {
434 if(response == '101: Timeout') {
435 $log.error('Timeout attempting to get_functional_menu');
436 // TIMEOUT USED FOR LOCAL TESTING ONLY
437 // $scope.createErrorMenu();
438 $scope.megaMenuDataObject = menuStructureConvert('');
440 $log.debug('get_functional_menu success: ' + response);
441 if(typeof response != 'undefined' && response.length!=0 && typeof response[0] != 'undefined' && typeof response[0].error!="undefined"){
442 // createErrorMenu() USED FOR LOCAL TESTING ONLY
443 // $scope.createErrorMenu();
444 $scope.megaMenuDataObject = menuStructureConvert('');
445 // $scope.loadMenufail=true;
447 $scope.jsonMenuData = unflatten( response );
448 $scope.megaMenuDataObject = menuStructureConvert($scope.jsonMenuData);
451 }).error(function (response){
452 // createErrorMenu() USED FOR LOCAL TESTING ONLY
453 // $scope.createErrorMenu();
455 //$scope.loadMenufail=true;
456 $scope.megaMenuDataObject = menuStructureConvert('');
457 $log.debug('REST API failed get_functional_menu...'+ response);
460 $scope.adjustHLeftMenu = function (type){
461 $scope.showHeader = ($cookies.show_app_header == undefined ? true : $cookies.show_app_header);
463 if($scope.showHeader == true) {
464 $scope.drawer_margin_top = 60;
465 $scope.drawer_custom_top = 54;
466 $scope.toggle_drawer_top = 55;
470 $scope.drawer_margin_top = 50;
471 $scope.drawer_custom_top = 0;
472 $scope.toggle_drawer_top = 10;
474 if(type=='burgerIcon'){
475 return { "top": $scope.toggle_drawer_top+"px"};
476 }else if(type=='leftMenu'){
477 return { "margin-top": $scope.drawer_margin_top+"px"};
481 $scope.adjustHeader=function() {
482 $scope.showHeader = ($cookies.show_app_header == undefined ? true : $cookies.show_app_header);
484 if($scope.showHeader == true) {
485 $scope.drawer_margin_top = 50;
486 $scope.drawer_custom_top = 54;
487 $scope.toggle_drawer_top = 55;
491 $scope.drawer_margin_top = 40;
492 $scope.drawer_custom_top = 0;
493 $scope.toggle_drawer_top = 10;
501 $scope.adjustHeader();
504 /* **************************************************************************/
505 /* Logic for the favorite menus is here */
507 $scope.loadFavorites = function () {
508 $log.debug('loadFavorites has happened.');
509 if ($scope.favoritesMenuItems == '') {
510 $scope.generateFavoriteItems();
511 $log.debug('loadFavorites is calling generateFavoriteItems()');
513 $log.debug('loadFavorites is NOT calling generateFavoriteItems()');
517 $scope.goToUrl = function (item) {
518 $log.info("goToUrl called")
522 var restrictedApp = item.restrictedApp;
523 $log.debug('Restricted app status is: ' + restrictedApp);
525 $log.info('No url found for this application, doing nothing..');
529 $window.open(url, '_blank');
531 $window.open(url, '_self');
536 $scope.submenuLevelAction = function(index, column) {
537 if ($scope.favoritesMenuItems == '') {
538 $scope.generateFavoriteItems();
539 $log.debug('submenuLevelAction is calling generateFavoriteItems()');
541 $log.debug('item hovered/clicked: ' + index + '; column = ' + column);
542 if (column == 2) { // 2 is Design
543 $scope.favoritesWindow = false;
544 $scope.showFavorites = false;
545 $scope.emptyFavorites = false;
547 if (index=='Favorites' && $scope.favoriteItemsCount != 0) {
548 $log.debug('Showing Favorites window');
549 $scope.favoritesWindow = true;
550 $scope.showFavorites = true;
551 $scope.emptyFavorites = false;
553 if (index=='Favorites' && $scope.favoriteItemsCount == 0) {
554 $log.debug('Hiding Favorites window in favor of No Favorites Window');
555 $scope.favoritesWindow = true;
556 $scope.showFavorites = false;
557 $scope.emptyFavorites = true;
560 $scope.favoritesWindow = false;
561 $scope.showFavorites = false;
562 $scope.emptyFavorites = false;
566 $scope.hideFavoritesWindow = function() {
567 $log.debug('$scope.hideFavoritesWindow has been called');
568 $scope.showFavorites = false;
569 $scope.emptyFavorites = false;
572 $scope.isUrlFavorite = function (menuId) {
573 // $log.debug('array objects in menu favorites = ' + $scope.favoriteItemsCount + '; menuId=' + menuId);
574 var jsonMenu = JSON.stringify($scope.favoritesMenuItems);
575 var isMenuFavorite = jsonMenu.indexOf('menuId\":' + menuId);
576 if (isMenuFavorite==-1) {
584 $scope.generateFavoriteItems = function() {
587 url: 'get_favorites',
588 // TIMEOUT USED FOR LOCAL TESTING ONLY
590 }).success(function (response) {
591 if (response == '101: Timeout') {
592 $log.error('Timeout attempting to get_favorites_menu');
594 if(typeof response != 'undefined' && response.length!=0 && typeof response[0] != 'undefined' && typeof response[0].error!="undefined"){
595 $log.error('REST API failed get_favorites' + response);
597 $log.debug('get_favorites = ' + JSON.stringify(response));
598 $scope.favoritesMenuItems = response;
599 $scope.favoriteItemsCount = Object.keys($scope.favoritesMenuItems).length;
600 $log.info('number of favorite menus: ' + $scope.favoriteItemsCount);
603 }).error(function (response){
604 $log.error('REST API failed get_favorites' + response);
605 //createFavoriteErrorMenu() USED FOR LOCAL TESTING ONLY
606 // $scope.createFavoriteErrorMenu();
610 $scope.createFavoriteErrorMenu=function() {
611 $scope.favoritesMenuItems = [];
612 $scope.favoriteItemsCount = Object.keys($scope.favoritesMenuItems).length;
613 $log.info('number of favorite menus: ' + $scope.favoriteItemsCount);
616 /* end of Favorite Menu code */
617 /* **************************************************************************/
620 /* **************************************************************************/
621 // THIS IS USED FOR LOCAL TESTING ONLY
622 /* **************************************************************************/
624 $scope.createErrorMenu=function() {
625 $scope.jsonMenuData = [
630 "parentMenuId": null,
636 "text": "Infrastructure Ordering",
637 "parentMenuId": null,
643 "text": "Service Creation",
644 "parentMenuId": null,
650 "text": "Service Mgmt",
651 "parentMenuId": null,
659 "url": "http://google.com"
664 "text": "Mike Little's Coffee Cup",
666 "url": "http://coffee.com"
671 "text": "Andy and his Astrophotgraphy",
673 "url": "http://nightskypix.com"
680 "url": "http://http://jsonlint.com"
685 "text": "3rd Level App1c R200",
687 "url": "http://app1c.com"
692 "text": "3rd Level App4b R16",
694 "url": "http://app4b.com"
699 "text": "3rd Level App2b R16",
701 "url": "http://app2b.com"
707 "parentMenuId": null,
711 $scope.jsonMenuData = unflatten( $scope.jsonMenuData );
712 $scope.megaMenuDataObject = menuStructureConvert($scope.jsonMenuData);
713 // $log.debug(JSON.stringify($scope.jsonMenuData));
715 var childItemList="";
718 childItemList = ${menu.childItemList};
719 parentList = ${menu.parentList};
721 console.log("ebz_header: failed to get child/parent lists", err);
724 var pageUrl = window.location.href.split('/')[window.location.href.split('/').length-1];
726 $scope.menuItems = [];
727 for (var i = 0; i < parentList.length; i++) {
728 $scope.openCurrentMenu = false;
729 if(pageUrl==parentList[i].action)
730 $scope.openCurrentMenu = true;
731 $scope.childItemList = childItemList[i];
732 for(chIndex in $scope.childItemList){
733 if($scope.childItemList.length>0)
734 if($scope.childItemList[chIndex].action!=null){
735 if($scope.childItemList[chIndex].action==pageUrl)
736 $scope.openCurrentMenu = true;
740 parentLabel : parentList[i].label,
741 parentAction : parentList[i].action,
742 parentImageSrc : parentList[i].imageSrc,
743 open:$scope.openCurrentMenu,
744 childItemList : $scope.childItemList
746 $scope.menuItems.push($scope.item);
748 $scope.arrowShow = true;
749 $scope.drawerOpen = false;
750 $scope.subMenuContent = false;
751 $scope.toggleSubMenu = function() {
752 $scope.subMenuContent = !$scope.subMenuContent;
755 var drawerOpen = 'open';
756 if (drawerOpen == 'open') {
757 $scope.drawerOpen = true;
758 $scope.arrowShow = true;
760 $scope.arrowShow = false;
762 $scope.arrowShow = true;
763 $scope.drawerOpen = false;
764 $scope.toggleDrawer = function() {
765 $scope.drawerOpen = !($scope.drawerOpen);
766 if ($scope.drawerOpen) {
767 $scope.arrowShow = true;
768 if (document.getElementById('mContent')!=null)
769 document.getElementById('mContent').style.marginLeft = "0px";
771 $scope.arrowShow = false;
772 if (document.getElementById('mContent')!=null)
773 document.getElementById('mContent').style.marginLeft = "-150px";
776 //var drawerOpen = getCookie('drawerOpen');
777 if (drawerOpen == 'open') {
778 $scope.drawerOpen = true;
779 $scope.arrowShow = true;
781 $scope.arrowShow = false;
783 $timeout(function() {
789 app.filter("ellipsis", function(){
790 return function(text, length){
792 var ellipsis = text.length > length ? "..." : "";
793 return text.slice(0, length) + ellipsis;