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.openecomp.portalsdk.core.util.SystemProperties"%>
24 <%@ page import="org.openecomp.portalsdk.core.onboarding.util.PortalApiProperties"%>
25 <%@ page import="org.openecomp.portalsdk.core.onboarding.util.PortalApiConstants"%>
26 <%@ page import="org.openecomp.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="//cdnjs.cloudflare.com/ajax/libs/lodash.js/0.10.0/lodash.min.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>
55 <c:set var="UserName" value="<%= session.getAttribute(\"fullName\")%>" />
56 <c:set var="UserFirstName" value="<%= session.getAttribute(\"first_name\")%>" />
59 String contactUsLink = SystemProperties.getProperty(SystemProperties.CONTACT_US_LINK);
60 String redirectUrl = PortalApiProperties.getProperty(PortalApiConstants.ECOMP_REDIRECT_URL);
61 String portalUrl = redirectUrl.substring(0, redirectUrl.lastIndexOf('/')) + "/process_csp";
62 String getAccessLink = redirectUrl.substring(0, redirectUrl.lastIndexOf('/')) + "/get_access";
64 <c:set var="returnPortalUrl" value="<%=portalUrl%>" />
65 <c:set var="contactUsLink" value="<%=contactUsLink%>" />
66 <c:set var="getAccessLink" value="<%=getAccessLink%>" />
71 <%@include file="/WEB-INF/fusion/jsp/ebz/loginSnippet.html" %>
73 <div style="position: relative; z-index: 999;">
74 <div ng-controller="headerController">
76 <div class="headerContainer" id="headerContainer" ng-cloak ng-show="{{showHeader}}">
77 <div id="megaMenuContainer" class="megaMenuContainer" style="margin-top: 0; overflow: visible;">
80 <!-- Mega Menu parent-tab directive with three models menu-items, active-sub-menu, active-menu -->
81 <div id="topMenu" class="top-megamenu" ng-mouseleave="activeClickSubMenu.x.active=false; activeClickMenu.x.active=false">
82 <div style="float:left;width:100%;"parent-tab menu-items="megaMenuDataObject" active-sub-menu='activeClickSubMenu.x' active-menu='activeClickMenu.x'>
83 <div parentmenu-tabs mega-menu="true" menu-items="megaMenuDataObject" style="height:55px;">
84 <div style="float:left">
85 <li class="megamenu__item" style="line-height:55px;" onclick="returnToPortal()">
86 <img src="app/fusion/external/ebz/images/att_logo.png" class="ATTLogo" ></span>
87 <strong style="font-weight: 400 !important; font-family: "Omnes-ECOMP-W02", Arial !important; font-size: 18px;" id='returnPortal' >ECOMP Portal</strong>
89 <div menu-tabs mega-menu="true" tab-name="item.text" menu-item="item" active-menu="activeClickMenu.x"
90 ng-repeat="item in megaMenuDataObject" style="font-size: 18px;" ng-mousedown="loadFavorites()" >
91 <div parentmenu-tabs sub-menu="true" ng-show="activeClickMenu.x.active && item.active" menu-items="activeClickMenu.x.children">
92 <!-- Second level menu -->
94 <div menu-tabs sub-menu="true" tab-name="subItem.text"
95 tab-url="subItem.url" menu-item="subItem"
96 ng-repeat="subItem in activeClickMenu.x.children | orderBy : 'column'" active-menu="activeClickSubMenu.x"
97 sub-item-active="{{subItem.active}}" style="float:left;" aria-label="{{subItem.text}}"
98 ng-mouseenter="submenuLevelAction(subItem.text,subItem.column)"
99 ng-mouseleave="submenuLevelAction(subItem.text,subItem.column)"
100 ng-click="submenuLevelAction(subItem.text,subItem.column)" >
101 <i ng-if="subItem.text=='Favorites'" id="favorite-star"
102 class="icon-star favorites-icon-active">
106 <div class="sub__menu" ng-mouseleave="activeClickSubMenu.x.active=false" >
107 <ul ng-show="activeClickSubMenu.x.active" role="menubar" class="columns">
108 <!-- Third level menu -->
109 <div menu-tabs menu-item="subItem"
111 ng-repeat="subItem in activeClickSubMenu.x.children | orderBy : 'column'"
112 ng-show="activeClickSubMenu.x.active">
114 <i id="favorite-selector-third-level"
115 ng-show="isUrlFavorite(subItem.menuId)==false"
116 class="icon-star favorites-icon-inactive"
117 ng-if="subItem.url.length > 1">
119 <i id="favorite-selector-third-level"
120 ng-show="isUrlFavorite(subItem.menuId)"
121 class="icon-star favorites-icon-active"
122 ng-if="subItem.url.length > 1">
124 <span class="title" aria-label="{{subItem.text}}"
125 ng-click="goToUrl(subItem)">{{subItem.text}}</span>
126 <!-- Fourth level menus -->
127 <div att-links-list="">
128 <i id="favorite-selector-fourth-level"
129 class="icon-star favorites-icon-inactive"
130 ng-show="isUrlFavorite(tabValue.menuId)==false"
131 ng-if="tabValue.url.length > 1">
134 <i id="favorite-selector-fourth-level"
135 class="icon-star favorites-icon-active"
136 ng-show="isUrlFavorite(tabValue.menuId)"
137 ng-if="tabValue.url.length > 1">
140 <span role="menuitem" att-links-list-item=""
141 ng-repeat="tabValue in subItem.children"
142 ng-click="goToUrl(tabValue)"
143 att-accessibility-click="13,32"
144 ng-class="{'disabled': tabValue.disabled}">{{tabValue.text}}</span>
146 <hr ng-show="!$last"/>
150 <!-- Favorites level menu -->
151 <div class="favorites-window" ng-show='favoritesWindow' ng-mouseleave="hideFavoritesWindow()">
152 <div id="favorites-menu-items" ng-show="showFavorites">
153 <div ng-repeat="subItem in favoritesMenuItems" att-links-list="" style='display: inline'>
154 <i id="favorite-selector-favorites-list" class="icon-star favorites-icon-active">
156 <a id="favorites-list" aria-label="{{subItem.text}}"
157 ng-click="goToUrl(subItem)"
158 style="margin-left: 3px; margin-right: 20px; text-decoration: none; color: #666666;">
164 <p style='font-weight: 400; font-family: "Omnes-ECOMP-W02", Arial !important;
165 font-size: 18px; text-align: center; background-color: lightgray;
166 width: 400px; margin-left: 25%; margin-right: 25%;'>
167 Manage favorites on ECOMP Portal.
171 <!-- Favorites when empty -->
172 <div id="favorites-empty" ng-show='favoritesWindow' ng-show="emptyFavorites">
173 <div id="favorites-empty" ng-show="emptyFavorites" class="favorites-window-empty">
175 <img src="app/fusion/external/ebz/images/no_favorites_star.png">
176 <p class='favoritesLargeText'>No Favorites</p>
177 <p class='favoritesNormalText'>Manage favorites on ECOMP Portal.</p>
187 <li class="megamenu__item" style="line-height:55px;" ng-if="loadMenufail">
188 <strong style="font-weight: 400 !important; font-family: "Omnes-ECOMP-W02", Arial !important; font-size: 18px;" >Unable to load menus</strong>
190 <!-- <li class="megamenu__item" style="width: 20%;"> </li>
192 <!-- Login Snippet-->
193 <div style="float:right">
194 <li id="bcLoginSnippet" class="megamenu__item" style="width: 140px;" >
195 <div popover="loginSnippet.html" aria-label="Login Snippet" referby="loginSnippet" att-accessibility-click="13,32" popover-style="\" popover-placement="below" style="width: 200px;">
196 <div class="icon-user-small login-snippet-icon"></div>
197 <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>
200 <li class="megamenu__item" style="width:120px;"> </li>
205 <div style="clear: both"></div>
210 <div class="license-notification" id="license-notification">
211 <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" >
212 <span style="">{{app_name_full}}</span>
215 <div style="position: relative; color: black; top: 70px;">
217 <span ng-style="adjustHLeftMenu('burgerIcon')" style="z-index:998; position:fixed; left:0%; font-size:35px; margin-left:10px;text-decoration:none;">
218 <a ng-click="toggleDrawer();isOpen = !isOpen" href="javascript:void(0);" class="arrow-icon-left" >
219 <span class="icon-hamburger"></span></a>
220 <span ng-init="isOpen = true" ng-show="isOpen" style="font-size:16px; position:relative; top:-8px; left:-15px;">    {{app_name}}</span>
222 <div att-drawer drawer-slide="left" drawer-custom-top="{{drawer_custom_top}}px" drawer-size="200px" drawer-open="drawerOpen" drawer-custom-height="100%" >
223 <div ng-style="adjustHLeftMenu('leftMenu')">
224 <div class="attDrawer" style="margin-top:{{drawer_margin_top}}px;">
225 <div style="margin-left:10px; margin-right:10px;">
226 <accordion close-others="true" css="att-accordion--no-box">
227 <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">
228 <div ng-repeat="subMenu in parent.childItemList" style="font-size:12px; margin-left:10px;">
229 <a href="{{subMenu.action}}" style="font-size:12px; color:#666666;" >{{subMenu.label}}</a>
243 function returnToPortal(){
244 window.location.href = "<c:out value='${returnPortalUrl}'/>";
246 detectScrollEvent = function() {
247 var footerOff = $('#footerContainer').offset().top;
248 var headOff = $('#headerContainer').offset().top;
249 var winHeight = $(window).height();
250 if ((footerOff - headOff) <= winHeight) {
251 $('.att-drawer').css({
252 "height" : footerOff - headOff - 55
255 $('.att-drawer').css({
260 $(window).scroll(function() {
261 if ($('.att-drawer').is(':visible')) {
265 app.controller("headerController", function($scope, $timeout, $log, $http, UserInfoService, $window, $cookies,LeftMenuService) {
266 // $log.debug('HeaderController started');
267 $scope.jsonMenuData = [];
268 $scope.loadMenufail=false;
269 $scope.app_name = "";
270 $scope.app_name_full = "";
271 $scope.megaMenuDataObject =[];
272 $scope.activeClickSubMenu = {
275 $scope.activeClickMenu = {
278 $scope.favoritesMenuItems = [];
279 $scope.favoriteItemsCount = 0;
280 $scope.showFavorites = false;
281 $scope.emptyFavorites = false;
282 $scope.favoritesWindow = false;
289 /*Put user info into fields*/
290 $scope.inputUserInfo = function(userInfo){
291 if (typeof(userInfo) != "undefined" && userInfo!=null && userInfo!=''){
292 if (typeof(userInfo.USER_FIRST_NAME) != "undefined" && userInfo.USER_FIRST_NAME!=null && userInfo.USER_FIRST_NAME!='')
293 $scope.userProfile.firstName = userInfo.USER_FIRST_NAME;
294 if (typeof(userInfo.USER_LAST_NAME) != "undefined" && userInfo.USER_LAST_NAME!=null && userInfo.USER_LAST_NAME!='')
295 $scope.userProfile.lastName = userInfo.USER_LAST_NAME;
296 if (typeof(userInfo.USER_EMAIL) != "undefined" && userInfo.USER_EMAIL!=null && userInfo.USER_EMAIL!='')
297 $scope.userProfile.email = userInfo.USER_EMAIL;
300 /*getting user info from session*/
301 $scope.getUserNameFromSession = function(){
302 UserInfoService.getFunctionalMenuStaticDetailSession()
303 .then(function (res) {
304 $scope.userProfile.firstName = res.firstName;
305 $scope.redirectUrl = res.portalUrl;
308 $scope.getTopMenuStaticInfo=function() {
309 var promise = UserInfoService.getFunctionalMenuStaticDetailShareContext();
312 if(res==null || res==''){
313 $log.info('failed getting static User information');
314 $scope.getUserNameFromSession();
316 $log.info('Received static User information');
318 $scope.inputUserInfo(resData);
319 $scope.userProfile.fullName = $scope.userProfile.firstName+ ' '+ $scope.userProfile.lastName;
323 $log.info('failed getting static User information');
328 var unflatten = function( array, parent, tree ){
329 tree = typeof tree !== 'undefined' ? tree : [];
330 parent = typeof parent !== 'undefined' ? parent : { menuId: null };
331 var children = _.filter( array, function(child){ return child.parentMenuId == parent.menuId; });
333 if( !_.isEmpty( children ) ){
334 if( parent.menuId === null ){
337 parent['children'] = children
339 _.each( children, function( child ){ unflatten( array, child ) } );
345 var menuStructureConvert = function(menuItems) {
346 var megaMenuDataObjectTemp = [
355 url:"<c:out value='${contactUsLink}'/>"
359 url:"<c:out value='${getAccessLink}'/>"
363 return megaMenuDataObjectTemp;
368 LeftMenuService.getAppName().then(function(response){
371 if(j && j !== "null" && j!== "undefined"){
372 // console.log("app name is " + $scope.app_name);
373 $scope.app_name_full = j.data;
374 var processed_app_name = j.data;
375 if(processed_app_name.indexOf("[")<=-1) {
376 if (document.getElementById('license-notification')!=null)
377 document.getElementById('license-notification').style.display = "none";
379 var n = processed_app_name.length;
383 $scope.app_name = processed_app_name.substr(0, n);
385 throw "Get app_name response is not an object/is empty";
388 console.log("error happened while trying to get app name "+e);
392 console.log('getAppName failed', error);
395 $scope.getTopMenuStaticInfo();
396 $scope.getMenu=function() {
400 url: 'get_functional_menu',
401 // TIMEOUT USED FOR LOCAL TESTING ONLY
403 }).success(function (response) {
404 if(response == '101: Timeout') {
405 $log.error('Timeout attempting to get_functional_menu');
406 // TIMEOUT USED FOR LOCAL TESTING ONLY
407 // $scope.createErrorMenu();
408 $scope.megaMenuDataObject = menuStructureConvert('');
410 $log.debug('get_functional_menu success: ' + response);
411 if(typeof response != 'undefined' && response.length!=0 && typeof response[0] != 'undefined' && typeof response[0].error!="undefined"){
412 // createErrorMenu() USED FOR LOCAL TESTING ONLY
413 // $scope.createErrorMenu();
414 $scope.megaMenuDataObject = menuStructureConvert('');
415 // $scope.loadMenufail=true;
417 $scope.jsonMenuData = unflatten( response );
418 $scope.megaMenuDataObject = menuStructureConvert($scope.jsonMenuData);
421 }).error(function (response){
422 // createErrorMenu() USED FOR LOCAL TESTING ONLY
423 // $scope.createErrorMenu();
425 //$scope.loadMenufail=true;
426 $scope.megaMenuDataObject = menuStructureConvert('');
427 $log.debug('REST API failed get_functional_menu...'+ response);
430 $scope.adjustHLeftMenu = function (type){
431 $scope.showHeader = ($cookies.show_app_header == undefined ? true : $cookies.show_app_header);
433 if($scope.showHeader == true) {
434 $scope.drawer_margin_top = 60;
435 $scope.drawer_custom_top = 54;
436 $scope.toggle_drawer_top = 55;
440 $scope.drawer_margin_top = 50;
441 $scope.drawer_custom_top = 0;
442 $scope.toggle_drawer_top = 10;
444 if(type=='burgerIcon'){
445 return { "top": $scope.toggle_drawer_top+"px"};
446 }else if(type=='leftMenu'){
447 return { "margin-top": $scope.drawer_margin_top+"px"};
451 $scope.adjustHeader=function() {
452 $scope.showHeader = ($cookies.show_app_header == undefined ? true : $cookies.show_app_header);
454 if($scope.showHeader == true) {
455 $scope.drawer_margin_top = 50;
456 $scope.drawer_custom_top = 54;
457 $scope.toggle_drawer_top = 55;
461 $scope.drawer_margin_top = 40;
462 $scope.drawer_custom_top = 0;
463 $scope.toggle_drawer_top = 10;
471 $scope.adjustHeader();
474 /* **************************************************************************/
475 /* Logic for the favorite menus is here */
477 $scope.loadFavorites = function () {
478 $log.debug('loadFavorites has happened.');
479 if ($scope.favoritesMenuItems == '') {
480 $scope.generateFavoriteItems();
481 $log.debug('loadFavorites is calling generateFavoriteItems()');
483 $log.debug('loadFavorites is NOT calling generateFavoriteItems()');
487 $scope.goToUrl = function (item) {
488 $log.info("goToUrl called")
492 var restrictedApp = item.restrictedApp;
493 $log.debug('Restricted app status is: ' + restrictedApp);
495 $log.info('No url found for this application, doing nothing..');
499 $window.open(url, '_blank');
501 $window.open(url, '_self');
506 $scope.submenuLevelAction = function(index, column) {
507 if ($scope.favoritesMenuItems == '') {
508 $scope.generateFavoriteItems();
509 $log.debug('submenuLevelAction is calling generateFavoriteItems()');
511 $log.debug('item hovered/clicked: ' + index + '; column = ' + column);
512 if (column == 2) { // 2 is Design
513 $scope.favoritesWindow = false;
514 $scope.showFavorites = false;
515 $scope.emptyFavorites = false;
517 if (index=='Favorites' && $scope.favoriteItemsCount != 0) {
518 $log.debug('Showing Favorites window');
519 $scope.favoritesWindow = true;
520 $scope.showFavorites = true;
521 $scope.emptyFavorites = false;
523 if (index=='Favorites' && $scope.favoriteItemsCount == 0) {
524 $log.debug('Hiding Favorites window in favor of No Favorites Window');
525 $scope.favoritesWindow = true;
526 $scope.showFavorites = false;
527 $scope.emptyFavorites = true;
530 $scope.favoritesWindow = false;
531 $scope.showFavorites = false;
532 $scope.emptyFavorites = false;
536 $scope.hideFavoritesWindow = function() {
537 $log.debug('$scope.hideFavoritesWindow has been called');
538 $scope.showFavorites = false;
539 $scope.emptyFavorites = false;
542 $scope.isUrlFavorite = function (menuId) {
543 // $log.debug('array objects in menu favorites = ' + $scope.favoriteItemsCount + '; menuId=' + menuId);
544 var jsonMenu = JSON.stringify($scope.favoritesMenuItems);
545 var isMenuFavorite = jsonMenu.indexOf('menuId\":' + menuId);
546 if (isMenuFavorite==-1) {
554 $scope.generateFavoriteItems = function() {
557 url: 'get_favorites',
558 // TIMEOUT USED FOR LOCAL TESTING ONLY
560 }).success(function (response) {
561 if (response == '101: Timeout') {
562 $log.error('Timeout attempting to get_favorites_menu');
564 if(typeof response != 'undefined' && response.length!=0 && typeof response[0] != 'undefined' && typeof response[0].error!="undefined"){
565 $log.error('REST API failed get_favorites' + response);
567 $log.debug('get_favorites = ' + JSON.stringify(response));
568 $scope.favoritesMenuItems = response;
569 $scope.favoriteItemsCount = Object.keys($scope.favoritesMenuItems).length;
570 $log.info('number of favorite menus: ' + $scope.favoriteItemsCount);
573 }).error(function (response){
574 $log.error('REST API failed get_favorites' + response);
575 //createFavoriteErrorMenu() USED FOR LOCAL TESTING ONLY
576 // $scope.createFavoriteErrorMenu();
580 $scope.createFavoriteErrorMenu=function() {
581 $scope.favoritesMenuItems = [
584 $scope.favoriteItemsCount = Object.keys($scope.favoritesMenuItems).length;
585 $log.info('number of favorite menus: ' + $scope.favoriteItemsCount);
588 /* end of Favorite Menu code */
589 /* **************************************************************************/
592 /* **************************************************************************/
593 // THIS IS USED FOR LOCAL TESTING ONLY
594 /* **************************************************************************/
596 $scope.createErrorMenu=function() {
597 $scope.jsonMenuData = [
602 "parentMenuId": null,
608 "text": "Infrastructure Ordering",
609 "parentMenuId": null,
615 "text": "Service Creation",
616 "parentMenuId": null,
622 "text": "Service Mgmt",
623 "parentMenuId": null,
631 "url": "http://google.com"
636 "text": "Mike Little's Coffee Cup",
638 "url": "http://coffee.com"
643 "text": "Andy and his Astrophotgraphy",
645 "url": "http://nightskypix.com"
652 "url": "http://http://jsonlint.com"
659 "url": "http://ebiz.sbc.com/hronestop"
665 "text": "3rd Level App1c R200",
667 "url": "http://app1c.com"
672 "text": "3rd Level App4b R16",
674 "url": "http://app4b.com"
679 "text": "3rd Level App2b R16",
681 "url": "http://app2b.com"
687 "parentMenuId": null,
691 $scope.jsonMenuData = unflatten( $scope.jsonMenuData );
692 $scope.megaMenuDataObject = menuStructureConvert($scope.jsonMenuData);
693 // $log.debug(JSON.stringify($scope.jsonMenuData));
695 var childItemList="";
698 childItemList = ${menu.childItemList};
699 parentList = ${menu.parentList};
701 console.log("ebz_header: failed to get child/parent lists", err);
704 var pageUrl = window.location.href.split('/')[window.location.href.split('/').length-1];
706 $scope.menuItems = [];
707 for (var i = 0; i < parentList.length; i++) {
708 $scope.openCurrentMenu = false;
709 if(pageUrl==parentList[i].action)
710 $scope.openCurrentMenu = true;
711 $scope.childItemList = childItemList[i];
712 for(chIndex in $scope.childItemList){
713 if($scope.childItemList.length>0)
714 if($scope.childItemList[chIndex].action!=null){
715 if($scope.childItemList[chIndex].action==pageUrl)
716 $scope.openCurrentMenu = true;
720 parentLabel : parentList[i].label,
721 parentAction : parentList[i].action,
722 parentImageSrc : parentList[i].imageSrc,
723 open:$scope.openCurrentMenu,
724 childItemList : $scope.childItemList
726 $scope.menuItems.push($scope.item);
728 $scope.arrowShow = true;
729 $scope.drawerOpen = false;
730 $scope.subMenuContent = false;
731 $scope.toggleSubMenu = function() {
732 $scope.subMenuContent = !$scope.subMenuContent;
735 var drawerOpen = 'open';
736 if (drawerOpen == 'open') {
737 $scope.drawerOpen = true;
738 $scope.arrowShow = true;
740 $scope.arrowShow = false;
742 $scope.arrowShow = true;
743 $scope.drawerOpen = false;
744 $scope.toggleDrawer = function() {
745 $scope.drawerOpen = !($scope.drawerOpen);
746 if ($scope.drawerOpen) {
747 $scope.arrowShow = true;
748 if (document.getElementById('mContent')!=null)
749 document.getElementById('mContent').style.marginLeft = "0px";
751 $scope.arrowShow = false;
752 if (document.getElementById('mContent')!=null)
753 document.getElementById('mContent').style.marginLeft = "-150px";
756 //var drawerOpen = getCookie('drawerOpen');
757 if (drawerOpen == 'open') {
758 $scope.drawerOpen = true;
759 $scope.arrowShow = true;
761 $scope.arrowShow = false;
763 $timeout(function() {
769 app.filter("ellipsis", function(){
770 return function(text, length){
772 var ellipsis = text.length > length ? "..." : "";
773 return text.slice(0, length) + ellipsis;