summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2015-02-06 12:14:16 +0200
committerAlon Levy <alon@pobox.com>2015-02-06 12:14:16 +0200
commitebfbcd315e4cfb5324fb848d588948d3cdb25ddf (patch)
tree6e60d6e748680402cc94126c46bdd19b148c127a /src/client
parentb6756b8dd1aad3de178201d98a7980a4479c2b8a (diff)
client/graph_view: set checkboxes callback on load to avoid race with DOM creation
Diffstat (limited to 'src/client')
-rw-r--r--src/client/view/graph_view.js18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/client/view/graph_view.js b/src/client/view/graph_view.js
index d1e8ba40..578c05e3 100644
--- a/src/client/view/graph_view.js
+++ b/src/client/view/graph_view.js
@@ -120,15 +120,17 @@ function GraphView(spec) {
function redraw__set_on_checkbox_change()
{
- var checkboxes = $('.dropdown-item label input').asEventStream('click').onValue(function (_) {
- read_checkboxes();
- console.log(filter_states);
- update_view(true);
+ $(function () {
+ var checkboxes = $('.dropdown-item label input').asEventStream('click').onValue(function (_) {
+ read_checkboxes();
+ console.log(filter_states);
+ update_view(true);
+ });
+ $('.dropdown-item.dropdown-menu-heading').asEventStream('click').onValue(function (_) {
+ var hidden = $('.dropdown-item.dropdown-item-type[style="display:none"]').length > 0;
+ $('.dropdown-item.dropdown-item-type').attr('style', 'display:' + (hidden ? '' : 'none'));
+ })
});
- $('.dropdown-item.dropdown-menu-heading').asEventStream('click').onValue(function (_) {
- var hidden = $('.dropdown-item.dropdown-item-type[style="display:none"]').length > 0;
- $('.dropdown-item.dropdown-item-type').attr('style', 'display:' + (hidden ? '' : 'none'));
- })
}
function node__is_shown(d) {