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

fixed network graph typo

parent 4ebf8ef3
No related branches found
No related tags found
No related merge requests found
......@@ -36,6 +36,14 @@
<div class="row row-spaced">
<div class="col-md-12">
<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 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">
<span style="color:#BBC9D2">Articles</span><br>
<span style="color:#DBB234">Topics</span><br>
......
......@@ -78,7 +78,7 @@
$scope.page = Math.max($stateParams.page || 1, 1);
$scope.limit = pageSize;
$scope.sort = Store('sortarticles-' + $state.current.name) || 'date';
$scope.sort = Store('sortarticles') || 'date';
$scope.reload = function() {
ArticleFactory.query({
......@@ -148,12 +148,12 @@
* Topic Controllers
*/
app.controller('TopicsIndexController', ['$scope', '$stateParams', 'TopicFactory',
function($scope, $stateParams, TopicFactory) {
app.controller('TopicsIndexController', ['$scope', '$stateParams', 'Store', 'TopicFactory',
function($scope, $stateParams, Store, TopicFactory) {
$scope.page = Math.max($stateParams.page || 1, 1);
$scope.limit = pageSize;
$scope.sort = Store('sorttopics-' + $state.current.name) || 'name';
$scope.sort = Store('sorttopics') || 'name';
$scope.reload = function() {
TopicFactory.query({
......@@ -192,12 +192,12 @@
* Word Controllers
*/
app.controller('WordsIndexController', ['$scope', '$state', '$stateParams', 'WordFactory',
function($scope, $state, $stateParams, WordFactory) {
app.controller('WordsIndexController', ['$scope', '$state', '$stateParams', 'Store', 'WordFactory',
function($scope, $state, $stateParams, Store, WordFactory) {
$scope.page = Math.max($stateParams.page || 1, 1);
$scope.limit = 300;
$scope.sort = Store('sortwords-' + $state.current.name) || 'word';
$scope.sort = Store('sortwords') || 'word';
$scope.reload = function() {
WordFactory.query({
......
......@@ -93,6 +93,11 @@
shape: 'dot',
borderWidth: 0
},
edges: {
color: {
highlight: '#f00'
}
},
layout: { randomSeed: 1 },
physics: {
barnesHut: {
......@@ -249,7 +254,7 @@
var target = $($scope.target);
if(!target.length) return;
var store = $scope.store !== 'false';
var name = 'hidelink-' + $state.current.name + '-' + $scope.target;
var name = 'hidelink-' + $scope.target;
if(store) {
var visible = Store(name);
if(visible !== null && typeof visible !== 'undefined')
......@@ -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 @@
});
}]);
app.factory('Store', function() {
app.factory('Store', ['$state', function($state) {
// https://gist.github.com/Fluidbyte/4718380
return function(key, value) {
key += '-' + $state.current.name;
var lsSupport = false;
// Check for native support
......@@ -97,6 +98,6 @@
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