nitweb: factorize graph directive
authorAlexandre Terrasa <alexandre@moz-code.org>
Tue, 2 Aug 2016 02:30:05 +0000 (22:30 -0400)
committerAlexandre Terrasa <alexandre@moz-code.org>
Wed, 17 Aug 2016 16:54:08 +0000 (12:54 -0400)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

share/nitweb/directives/entity/graph.html [new file with mode: 0644]
share/nitweb/javascripts/entities.js
share/nitweb/views/class.html
share/nitweb/views/group.html
share/nitweb/views/module.html
share/nitweb/views/package.html

diff --git a/share/nitweb/directives/entity/graph.html b/share/nitweb/directives/entity/graph.html
new file mode 100644 (file)
index 0000000..43387c4
--- /dev/null
@@ -0,0 +1 @@
+<div class='graph' ng-bind-html='graph'></div>
index 5d8a7dd..eb65e93 100644 (file)
                        };
                })
 
+               .directive('entityGraph', function() {
+                       return {
+                               restrict: 'E',
+                               scope: {
+                                       mentity: '=',
+                                       graph: '='
+                               },
+                               replace: true,
+                               templateUrl: '/directives/entity/graph.html'
+                       };
+               })
+
                .directive('entityCard', function() {
                        return {
                                restrict: 'E',
index ec8ffee..278d5e9 100644 (file)
@@ -59,7 +59,7 @@
        <div role='tabpanel' class='tab-pane fade' id='graph'>
                <div class='card'>
                        <div class='card-body text-center'>
-                               <div class='graph' ng-bind-html='graph'></div>
+                               <entity-graph mentity='mentity' graph='graph' />
                        </div>
                </div>
        </div>
index 097ec4a..f7f60db 100644 (file)
@@ -32,7 +32,7 @@
        <div role='tabpanel' class='tab-pane fade' id='graph'>
                <div class='card'>
                        <div class='card-body text-center'>
-                               <div class='graph' ng-bind-html='graph'></div>
+                               <entity-graph mentity='mentity' graph='graph' />
                        </div>
                </div>
        </div>
index 29e8130..6288013 100644 (file)
@@ -55,7 +55,7 @@
        <div class='tab-pane fade' id='graph'>
                <div class='card'>
                        <div class='card-body text-center'>
-                               <div class='graph' ng-bind-html='graph'></div>
+                               <entity-graph mentity='mentity' graph='graph' />
                        </div>
                </div>
        </div>
index f1f3055..306dd52 100644 (file)
@@ -26,7 +26,7 @@
        <div role='tabpanel' class='tab-pane fade' id='graph'>
                <div class='card'>
                        <div class='card-body text-center'>
-                               <div class='graph' ng-bind-html='graph'></div>
+                               <entity-graph mentity='mentity' graph='graph' />
                        </div>
                </div>
        </div>