refactor selected nodes
[myslice.git] / plugins / senslabmap / static / js / senslabmap.js
index 2945e0d..fbdf849 100644 (file)
@@ -22,7 +22,7 @@
     },
     
     on_all_new_record: function(node) {
-      Senslab.normalize(node, this.key);
+      Senslab.normalize(node);
       if (node.normalized) {
         var site = node.site;
         if ($.inArray(site, this.sites) == -1) {
     },
     
     on_all_query_done: function() {
-      var self = this;
+      var uuid = this.options.query_uuid;
+      var key = this.key
       
-      Senslab.createMaps($('#maps-container'), this.sites, this.nodes);
+      Senslab.createMaps($("#maps-container"), this.sites, this.nodes);
       Senslab.notify = function(node) {
-        manifold.raise_event(self.options.query_uuid,
-                             node.boot_state == "Alive" ? SET_REMOVED : SET_ADD,
-                             node[self.key]
-                            );
+        manifold.raise_event(uuid, node.selected ? SET_ADD : SET_REMOVED, node[key]);
       }
     }
   });