blob: aba7d141b722d7035aa49e05b4748578cd8433c1 [file] [log] [blame]
Thomas Vachuska5b48d6c2018-04-27 18:24:27 -07001// path painter topology overlay - client side
2//
3// This is the glue that binds our business logic (in ppTopov.js)
4// to the overlay framework.
5
6(function () {
7 'use strict';
8
9 // injected refs
10 var $log, tov, lts;
11
12 // our overlay definition
13 var overlay = {
14 overlayId: 'tl-overlay',
15 glyphId: 'm_disjointPaths',
16 tooltip: 'Algorithmic Layout Overlay',
17
18 activate: function () {
19 $log.debug("Layout topology overlay ACTIVATED");
20 },
21 deactivate: function () {
22 lts.clear();
23 $log.debug("Layout topology overlay DEACTIVATED");
24 },
25
26 keyBindings: {
27 0: {
28 cb: function () {
29 lts.doLayout('default', 'Default (force-based) Layout');
30 },
31 tt: 'Default (force-based) layout',
32 gid: 'm_fiberSwitch'
33 },
34 1: {
35 cb: function () {
36 lts.doLayout('access', 'Access Network Layout - separate service leafs');
37 },
38 tt: 'Access layout - separate service leafs',
39 gid: 'm_disjointPaths'
40 },
41
42 _keyOrder: [
43 '0', '1'
44 ]
45 }
46 };
47
48 // invoke code to register with the overlay service
49 angular.module('ovTlTopov')
50 .run(['$log', 'TopoOverlayService', 'LayoutTopovService',
51
52 function (_$log_, _tov_, _lts_) {
53 $log = _$log_;
54 tov = _tov_;
55 lts = _lts_;
56 tov.register(overlay);
57 }]);
58}());