From d182202fc6001983541504ed323d68479086317e Mon Sep 17 00:00:00 2001 From: WuKong Date: Sat, 22 Apr 2017 13:25:07 +0200 Subject: add moonv4 Change-Id: I247af788d0b0fb961fbc85416486b241eb1d807c Signed-off-by: WuKong --- .../static/app/services/gui/menu.service.js | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 moonv4/moon_gui/static/app/services/gui/menu.service.js (limited to 'moonv4/moon_gui/static/app/services/gui/menu.service.js') diff --git a/moonv4/moon_gui/static/app/services/gui/menu.service.js b/moonv4/moon_gui/static/app/services/gui/menu.service.js new file mode 100644 index 00000000..fd90a2fa --- /dev/null +++ b/moonv4/moon_gui/static/app/services/gui/menu.service.js @@ -0,0 +1,49 @@ +/** + * @author arnaud marhin + */ + +(function() { + + 'use strict'; + + angular + .module('moon') + .factory('menuService', menuService); + + menuService.$inject = ['$state']; + + function menuService($state) { + + var service = {}; + + service.isProjectTabActive = isProjectTabActive; + service.isPDPTabActive = isPDPTabActive; + service.isPolicyTabActive = isPolicyTabActive; + service.isLogsTabActive = isLogsTabActive; + service.isModelTabActive = isModelTabActive; + + return service; + + function isProjectTabActive() { + return $state.includes('moon.project'); + } + + function isPDPTabActive() { + return $state.includes('moon.pdp'); + } + + function isPolicyTabActive(){ + return $state.includes('moon.policy'); + } + + function isLogsTabActive(){ + return $state.includes('moon.logs'); + } + + function isModelTabActive(){ + return $state.includes('moon.model'); + } + + } + +})(); -- cgit 1.2.3-korg