/// module Navigation { export var pluginName = 'hawtio-navigation'; export var log = Logger.get(pluginName); export var _module = angular.module(pluginName, []); _module.run(() =>{ console.log("1"); }); _module.service('HawtioBreadcrumbs', () => { var _config = []; var self = { apply: (config) => { _config.length = 0; _.forEach(config, (crumb) => { _config.push(crumb); }); }, get: () => { return _config; } }; return self; }); _module.service('HawtioSubTabs', () => { var _config = []; var self = { apply: (config) => { _config.length = 0; _.forEach(config, (crumb) => { _config.push(crumb); }); }, get: () => { return _config; } } return self; }); _module.directive('hawtioRelativeHref', ['$location', ($location) => { return { restrict: 'A', link: (scope, element, attr) => { var targetPath = attr['hawtioRelativeHref']; var targetHref = new URI($location.url()); targetHref.segment(targetPath); element.attr('href', targetHref.toString()); } } }]); _module.directive('viewportHeight', ['$window', '$document', ($window, $document) => { return { restrict: 'A', link: (scope, element, attr) => { // log.debug("Window: ", $window); // log.debug("element: ", element); var win = $($window); var resizeFunc = () => { var viewportHeight = win.innerHeight(); // log.debug("Viewport height: ", viewportHeight); var elTop = element.offset().top; // log.debug("Element top: ", elTop); var height = viewportHeight - elTop; element.css('height', height); }; win.on('resize', resizeFunc); element.on('$destroy', () => { win.off('resize', resizeFunc); }); setTimeout(resizeFunc, 50); } } }]); _module.directive('hawtioMainOutlet', ['HawtioSubTabs', (HawtioSubTabs) => { return { restrict: 'A', link: (scope, element, attrs) => { scope.tabs = HawtioSubTabs; scope.$watchCollection('tabs.get()', (tabs) => { // log.debug("subTabConfig: ", subTabConfig); if (tabs && tabs.length > 0) { element.removeClass('hidden-nav'); element.css({ 'margin-left': '' }); } else { element.addClass('hidden-nav'); element.css({ 'margin-left': 'auto' }); } }); } }; }]); _module.directive('hawtioTabsOutlet', ['HawtioSubTabs', (HawtioSubTabs) => { var initialized = false; return { restrict: 'AE', replace: true, template: `