From 2e89bb3966ba94c78e9d77a51e85e39b0544b61d Mon Sep 17 00:00:00 2001 From: Alexandre Terrasa Date: Sat, 17 Jun 2017 16:49:21 -0400 Subject: [PATCH] nitweb: show parents and children in inheritance tab Signed-off-by: Alexandre Terrasa --- share/nitweb/javascripts/entities.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/share/nitweb/javascripts/entities.js b/share/nitweb/javascripts/entities.js index 2958f58..c5deb0a 100644 --- a/share/nitweb/javascripts/entities.js +++ b/share/nitweb/javascripts/entities.js @@ -80,10 +80,19 @@ $state.go('404', null, { location: false }) }); return d.promise; + }, + inh: function(Model, $q, $stateParams, $state) { + var d = $q.defer(); + Model.loadEntityInh($stateParams.id, d.resolve, + function() { + $state.go('404', null, { location: false }) + }); + return d.promise; } }, - controller: function(graph, $sce) { + controller: function(inh, graph, $sce) { this.graph = $sce.trustAsHtml(graph); + this.inh = inh; }, controllerAs: 'vm', }) @@ -227,6 +236,12 @@ .error(cbErr); }, + loadEntityInh: function(id, cb, cbErr) { + $http.get('/api/inheritance/' + id) + .success(cb) + .error(cbErr); + }, + search: function(q, n, cb, cbErr) { $http.get('/api/search?q=' + q + '&n=' + n) .success(cb) -- 1.7.9.5