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 * ================================================================================
22 * Custom version of b2b-left-navigation directive:
23 * 1. Make parent menu a link if no child menus.
24 * 2. Add unique IDs to all items.
25 * 3. Hide icon if no child menus.
26 * 4. Add arrow toggle button.
27 * 5. Adjust the page on collapse/expand.
30 constructor($rootScope) {
31 this.templateUrl = 'app/directives/b2b-leftnav-ext/b2b-leftnav-ext.tpl.html';
33 this.$rootScope = $rootScope;
34 this.link = this._link.bind(this);
43 scope.toggleNav = function (val,link) {
44 if (val === scope.idx) {
50 /*New function for ECOMP sdk*/
51 scope.toggleDrawer = function(showmenu){
52 scope.idx=-1; /*hide the sunmenus*/
54 document.getElementById('page-content').style.paddingLeft = "50px";
57 document.getElementById('page-content').style.paddingLeft = "230px";
59 scope.liveLink = function (evt, val1, val2) {
62 evt.stopPropagation();
66 angular.module('ecompApp').directive('leftMenuEcomp', ($rootScope) => new B2BLeftMenu($rootScope));