summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2015-03-08 12:16:22 +0200
committerAlon Levy <alon@pobox.com>2015-03-08 12:16:22 +0200
commit5adfc7654fb49e116e21bc8e8202d4a148be3780 (patch)
tree4d084ffddb4613e90a6c25e7d7f2ecb96ba913fe /src
parent1586cf7423ba350ea3a3afaa0566afe4521904e9 (diff)
client/filter: fix broken filter from recent model/types intro and third-internship-proposal removal
Diffstat (limited to 'src')
-rw-r--r--src/client/view/graph_view.js22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/client/view/graph_view.js b/src/client/view/graph_view.js
index 464c6756..98f15844 100644
--- a/src/client/view/graph_view.js
+++ b/src/client/view/graph_view.js
@@ -96,8 +96,7 @@ function GraphView(spec) {
cx,
cy,
// FIXME take filter names from index.html or both from graph db
- filter_states = _.object(_.map(model_types.nodetypes, function (type) { return [type, null]; })),
- filter_state_names = model_types.nodetypes;
+ filter_states = _.object(_.map(model_types.nodetypes, function (type) { return [type, null]; }));
util.assert(parent_element !== undefined && graph_name !== undefined &&
graph !== undefined && zoom_property !== undefined &&
@@ -120,16 +119,21 @@ function GraphView(spec) {
update_window_size();
function read_checkboxes() {
- var checkboxes = $('#menu__type-filter label input').map(
- function (i, checkbox){
- return checkbox.checked;
- }
- );
+ var name,
+ value,
+ // jquery map does flattens, and we don't want that
+ checkboxes = _.map($('#menu__type-filter label input'),
+ function (checkbox){
+ return [checkbox.name, checkbox.checked];
+ }
+ );
for (var i in checkboxes) {
- if (filter_state_names[i] === undefined) {
+ name = checkboxes[i][0];
+ value = checkboxes[i][1];
+ if (undefined === filter_states[name]) {
continue;
}
- filter_states[filter_state_names[i]] = checkboxes[i];
+ filter_states[name] = value;
}
}