From b54df0ddd0c6a0372327c5aa3668e5a6458fcd64 Mon Sep 17 00:00:00 2001 From: st782s Date: Thu, 4 May 2017 07:48:42 -0400 Subject: [PORTAL-7] Rebase This rebasing includes common libraries and common overlays projects abstraction of components Change-Id: I9a24a338665c7cd058978e8636bc412d9e2fdce8 Signed-off-by: st782s --- .../directives/left-menu/left-menu.directive.js | 90 +++++++++++ .../client/app/directives/left-menu/left-menu.less | 177 +++++++++++++++++++++ .../app/directives/left-menu/left-menu.tpl.html | 22 +++ 3 files changed, 289 insertions(+) create mode 100644 ecomp-portal-FE-common/client/app/directives/left-menu/left-menu.directive.js create mode 100644 ecomp-portal-FE-common/client/app/directives/left-menu/left-menu.less create mode 100644 ecomp-portal-FE-common/client/app/directives/left-menu/left-menu.tpl.html (limited to 'ecomp-portal-FE-common/client/app/directives/left-menu') diff --git a/ecomp-portal-FE-common/client/app/directives/left-menu/left-menu.directive.js b/ecomp-portal-FE-common/client/app/directives/left-menu/left-menu.directive.js new file mode 100644 index 00000000..98979e2c --- /dev/null +++ b/ecomp-portal-FE-common/client/app/directives/left-menu/left-menu.directive.js @@ -0,0 +1,90 @@ +/*- + * ================================================================================ + * ECOMP Portal + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ================================================================================ + */ +/** + * Created by nnaffar on 1/28/16. + */ +(function () { + class LeftMenu { + constructor($rootScope, userbarUpdateService,notificationService,auditLogService) { + this.templateUrl = 'app/directives/left-menu/left-menu.tpl.html'; + this.restrict = 'AE'; + this.$rootScope = $rootScope; + this.userbarUpdateService = userbarUpdateService; + this.notificationService = notificationService; + this.auditLogService= auditLogService; + this.link = this._link.bind(this); + this.scope = { + sidebarModel: '=' + } + } + _link(scope) { + let init = () => { + scope.isOpen = true; + }; + + init(); + + scope.refreshOnlineUsers = () => { + this.userbarUpdateService.setRefreshCount(this.userbarUpdateService.maxCount); + }; + + scope.refreshNotification = () => { + this.notificationService.setRefreshCount(this.notificationService.maxCount); + }; + + scope.toggleSidebar = () => { + scope.isOpen = !scope.isOpen; + if(scope.isOpen==true) + setContentPos(1); + else + setContentPos(0); + }; + scope.auditLog =(name) => { + this.auditLogService.storeAudit(1,'leftMenu',name); + }; + + + scope.isBrowserInternetExplorer = false; + scope.browserName = bowser.name; + + if (bowser.msie || bowser.msedge) { + scope.isBrowserInternetExplorer = true; + } else { + scope.isBrowserInternetExplorer = false; + } + + + this.$rootScope.$on('$stateChangeStart', () => { + scope.isOpen = true; + }); + } + } + angular.module('ecompApp').directive('leftMenu', ($rootScope,userbarUpdateService,notificationService,auditLogService) => new LeftMenu($rootScope,userbarUpdateService,notificationService,auditLogService)); +})(); + +function setContentPos(open) { + // console.log("*******************************************"); + if(open==1){ + $("#page-content" ).css( "padding-left", "210px" ); + }else{ + $("#page-content" ).css( "padding-left", "50px" ); + } + +} diff --git a/ecomp-portal-FE-common/client/app/directives/left-menu/left-menu.less b/ecomp-portal-FE-common/client/app/directives/left-menu/left-menu.less new file mode 100644 index 00000000..6c2043dd --- /dev/null +++ b/ecomp-portal-FE-common/client/app/directives/left-menu/left-menu.less @@ -0,0 +1,177 @@ +/** + * Created by nnaffar on 1/28/16. + */ +@sidebar-width: 200px; +@transition-duration: 0.25s; +@overlayer-opacity: 0.65; + +.left-menu-close-button { + padding-right: 10px; + font-size: 1.25em; + line-height: 18px; + position: absolute; + cursor: pointer; + vertical-align: middle; + top: @second-level-top; + left: 160px; + //-webkit-font-smoothing: antialiased; + height: 25px; + z-index: 101; + //box-shadow: 0 4px 5px rgba(0, 0, 0, .2); +} + +@-moz-document url-prefix() { + .close-button-arrow { + top: 115px; // bug in Firefox + } +} +.close-button-arrow{ + left: 180px; +} + +@-moz-document url-prefix() { + .open-button-arrow{ + top: 115px; // bug in Firefox + } +} + +.close-button-arrow{ + left: 180px; +} + +.open-button-arrow{ + left: 0; + padding-left: 13px; +} + +.ecomp-sidebar-container { + position: absolute; + display: block; + left: 0; + //width: inherit; + z-index: 100; + //transition: left @transition-duration; + margin-top: -15px; + + .ecomp-sidebar-main { + left: 0; + //background-color: ; + position: absolute; + margin-top: 125px; + width: @sidebar-width; + height: 100vh; + // .bg_portalWhite;//white for 1610 + .bg_portalGray; // gray for 1702 + //box-shadow: 0 4px 5px rgba(0, 0, 0, .2); + + //padding-right: 10px; + //padding-left: 10px; + + .accordion-container{ + margin-top: 45px; + } + .portal-accordion-font{ + font-size: .875rem; + //color: #666; + display: inline-block; + } + + .portal-accordion-active{ + color: @funcBlueLink !important; + .bg_portalWhite; + padding-left: 10px; + } + + .sub-item{ + .portal-accordion-font; + cursor: pointer; + height: 37px; + line-height: 37px; + padding-left: 20px; + padding-bottom: 10px; + vertical-align: middle; + width: 100%; + } + .sub-item:hover{ + .portal-accordion-active; + } + + .parent-item{ + .portal-accordion-font; + border-bottom: 1px solid @portalLGray; + cursor: pointer; + height: 37px; + line-height: 37px; + padding-bottom: 10px; + vertical-align: middle; + width: 100%; + padding-left: 10px; + } + + .parent-item:hover{ + .portal-accordion-active; + } + + } +} + +.open-sidebar { + width: @sidebar-width; +} + +.close-sidebar { + display: none; + width: 35px !important; + span {color: transparent} +} + +.content-overlayed { + position: fixed; + top: 110px; + right: 0; + bottom: 0; + left: 0; + background: none repeat scroll 0 0 @funcBkgGray; + z-index: 9999; +} +.fade-animation{ + opacity: @overlayer-opacity; + transition: opacity @transition-duration ease-in-out; +} +.fade-animation.ng-hide { + opacity:0; + transition: opacity @transition-duration ease-in-out; +} + +.left-menu-collapsed { + width: 22px !important; +} + +.leftmenu-arrow-expand{ + margin-left:200px +} +.leftmenu-arrow-collapse{ + margin-left:0px; +} + +.left-menu-div{ + margin-top:110px; + float: left; +} +.b2b-subnav-content > li > a { + display: inline-block; +} + +.leftment-items{ + margin-left:40px; +} + +.menu-icon { + line-height: 40px; +} + +.menu-icon-collapse { + line-height: 40px; + margin-top:10px; + margin-bottom:10px; +} diff --git a/ecomp-portal-FE-common/client/app/directives/left-menu/left-menu.tpl.html b/ecomp-portal-FE-common/client/app/directives/left-menu/left-menu.tpl.html new file mode 100644 index 00000000..4478bc8f --- /dev/null +++ b/ecomp-portal-FE-common/client/app/directives/left-menu/left-menu.tpl.html @@ -0,0 +1,22 @@ + +
+ +
-- cgit 1.2.3-korg