Skip to content
Snippets Groups Projects
Commit b07be460 authored by Eike Cochu's avatar Eike Cochu
Browse files

fixed network graph typo

parent 4ebf8ef3
Branches
No related tags found
No related merge requests found
...@@ -36,6 +36,14 @@ ...@@ -36,6 +36,14 @@
<div class="row row-spaced"> <div class="row row-spaced">
<div class="col-md-12"> <div class="col-md-12">
<input type="text" class="form-control input-lg" placeholder="Search..." ng-model="search" ng-model-options="{debounce:500}"> <input type="text" class="form-control input-lg" placeholder="Search..." ng-model="search" ng-model-options="{debounce:500}">
<p class="text-right">
<small>
<a toggle-link target="#advanced">Advanced...</a>
</small>
</p>
<div id="advanced" style="display:none">
</div>
</div> </div>
</div> </div>
......
<div class="fullsize navpadding" vis-graph vis-type="type" ng-model="model"> <div class="fullsize navpadding" vis-network vis-type="type" ng-model="model">
<div class="graph-legend"> <div class="graph-legend">
<span style="color:#BBC9D2">Articles</span><br> <span style="color:#BBC9D2">Articles</span><br>
<span style="color:#DBB234">Topics</span><br> <span style="color:#DBB234">Topics</span><br>
......
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
$scope.page = Math.max($stateParams.page || 1, 1); $scope.page = Math.max($stateParams.page || 1, 1);
$scope.limit = pageSize; $scope.limit = pageSize;
$scope.sort = Store('sortarticles-' + $state.current.name) || 'date'; $scope.sort = Store('sortarticles') || 'date';
$scope.reload = function() { $scope.reload = function() {
ArticleFactory.query({ ArticleFactory.query({
...@@ -148,12 +148,12 @@ ...@@ -148,12 +148,12 @@
* Topic Controllers * Topic Controllers
*/ */
app.controller('TopicsIndexController', ['$scope', '$stateParams', 'TopicFactory', app.controller('TopicsIndexController', ['$scope', '$stateParams', 'Store', 'TopicFactory',
function($scope, $stateParams, TopicFactory) { function($scope, $stateParams, Store, TopicFactory) {
$scope.page = Math.max($stateParams.page || 1, 1); $scope.page = Math.max($stateParams.page || 1, 1);
$scope.limit = pageSize; $scope.limit = pageSize;
$scope.sort = Store('sorttopics-' + $state.current.name) || 'name'; $scope.sort = Store('sorttopics') || 'name';
$scope.reload = function() { $scope.reload = function() {
TopicFactory.query({ TopicFactory.query({
...@@ -192,12 +192,12 @@ ...@@ -192,12 +192,12 @@
* Word Controllers * Word Controllers
*/ */
app.controller('WordsIndexController', ['$scope', '$state', '$stateParams', 'WordFactory', app.controller('WordsIndexController', ['$scope', '$state', '$stateParams', 'Store', 'WordFactory',
function($scope, $state, $stateParams, WordFactory) { function($scope, $state, $stateParams, Store, WordFactory) {
$scope.page = Math.max($stateParams.page || 1, 1); $scope.page = Math.max($stateParams.page || 1, 1);
$scope.limit = 300; $scope.limit = 300;
$scope.sort = Store('sortwords-' + $state.current.name) || 'word'; $scope.sort = Store('sortwords') || 'word';
$scope.reload = function() { $scope.reload = function() {
WordFactory.query({ WordFactory.query({
......
...@@ -93,6 +93,11 @@ ...@@ -93,6 +93,11 @@
shape: 'dot', shape: 'dot',
borderWidth: 0 borderWidth: 0
}, },
edges: {
color: {
highlight: '#f00'
}
},
layout: { randomSeed: 1 }, layout: { randomSeed: 1 },
physics: { physics: {
barnesHut: { barnesHut: {
...@@ -249,7 +254,7 @@ ...@@ -249,7 +254,7 @@
var target = $($scope.target); var target = $($scope.target);
if(!target.length) return; if(!target.length) return;
var store = $scope.store !== 'false'; var store = $scope.store !== 'false';
var name = 'hidelink-' + $state.current.name + '-' + $scope.target; var name = 'hidelink-' + $scope.target;
if(store) { if(store) {
var visible = Store(name); var visible = Store(name);
if(visible !== null && typeof visible !== 'undefined') if(visible !== null && typeof visible !== 'undefined')
...@@ -274,4 +279,17 @@ ...@@ -274,4 +279,17 @@
}; };
}]); }]);
app.directive('toggleLink', function() {
return {
link: function($scope, $elem, $attrs) {
var target = $($attrs.target);
if(target) {
$elem.click(function() {
target.slideToggle();
});
}
}
}
});
})(); })();
\ No newline at end of file
...@@ -32,9 +32,10 @@ ...@@ -32,9 +32,10 @@
}); });
}]); }]);
app.factory('Store', function() { app.factory('Store', ['$state', function($state) {
// https://gist.github.com/Fluidbyte/4718380 // https://gist.github.com/Fluidbyte/4718380
return function(key, value) { return function(key, value) {
key += '-' + $state.current.name;
var lsSupport = false; var lsSupport = false;
// Check for native support // Check for native support
...@@ -97,6 +98,6 @@ ...@@ -97,6 +98,6 @@
return null; return null;
} }
}; };
}); }]);
})(); })();
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment