diff options
author | 2017-09-01 11:57:47 +0800 | |
---|---|---|
committer | 2017-09-01 11:57:58 +0800 | |
commit | 57dbba269d19bc59fad89160200bb2dbcccb9003 (patch) | |
tree | d466041ceffa2161124ca79a48b3e077777c74b8 /usecaseui-common/src/main/webapp/app/fusion/scripts/DS2-directives/b2b-leftnav-ext.js | |
parent | 4ff32341a0af1972b44a7410e76e9b231131e7ab (diff) |
Upload Monitor function code
Change-Id: I33ad76221b4cb771a298ff240245fc24be664efb
Issue-Id: USECASEUI-6
Signed-off-by: shentao <shentao@chinamobile.com>
Diffstat (limited to 'usecaseui-common/src/main/webapp/app/fusion/scripts/DS2-directives/b2b-leftnav-ext.js')
-rw-r--r-- | usecaseui-common/src/main/webapp/app/fusion/scripts/DS2-directives/b2b-leftnav-ext.js | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/usecaseui-common/src/main/webapp/app/fusion/scripts/DS2-directives/b2b-leftnav-ext.js b/usecaseui-common/src/main/webapp/app/fusion/scripts/DS2-directives/b2b-leftnav-ext.js new file mode 100644 index 00000000..64da0a49 --- /dev/null +++ b/usecaseui-common/src/main/webapp/app/fusion/scripts/DS2-directives/b2b-leftnav-ext.js @@ -0,0 +1,64 @@ +appDS2.directive('leftMenuEcomp', function () { + /* + * Custom version of b2b-left-navigation directive: + * 1. Make parent menu a link if no child menus. + * 2. Add unique IDs to all items. + * 3. Hide icon if no child menus. + * 4. Arrow toggle button. + * 5. Adjust the page on collapse/expand. + */ + return { + restrict: 'EA', + templateUrl: 'app/fusion/scripts/DS2-view-models/b2b-leftnav-ext.html', + scope: { + menuData: '=' + }, + link: function (scope, element, attrs, ctrl) { + scope.idx = -1; + scope.itemIdx = -1; + scope.navIdx = -1; + /*assuming menu is expanded when page loads*/ + scope.showmenu=true; + scope.leftMenuClass= ""; + scope.leftMenuArrowClass="leftmenu-arrow-expand"; + scope.toggleNav = function (val,link,menuStatus) { + + if(!menuStatus){ + scope.toggleDrawer(menuStatus); + return; + } + if(link!=null && link!=''){ + location.href = link; + return; + } + if (val === scope.idx) { + scope.idx = -1; + return; + } + scope.idx = val; + }; + scope.toggleDrawer = function(menuStatus){ + scope.idx=-1; /*hide the sub menus*/ + if(menuStatus){ + //Collapse Menu + scope.showmenu=false; + scope.leftMenuClass = "left-menu-collapsed"; + scope.leftMenuArrowClass="leftmenu-arrow-collapse"; + document.getElementById('page-content').style.marginLeft = "50px"; + }else{ + //Expand Menu + scope.showmenu=true; + scope.leftMenuClass = ""; + scope.leftMenuArrowClass="leftmenu-arrow-expand"; + document.getElementById('page-content').style.marginLeft = "250px"; + } + + }; + scope.liveLink = function (evt, val1, val2) { + scope.itemIdx = val1; + scope.navIdx = val2; + evt.stopPropagation(); + }; + } + }; +});
\ No newline at end of file |