plugins: RESET state now distirnguished ADD and REMOVE events, hazelnut and googlemap...
[myslice.git] / plugins / hazelnut / static / js / hazelnut.js
index 91fe152..af2dcfa 100644 (file)
 
         set_checkbox: function(record, checked)
         {
+            /* Default: checked = true */
+            if (typeof checked === 'undefined')
+                checked = true;
+
             var key_value;
             /* The function accepts both records and their key */
             switch (manifold.get_type(record)) {
 
             var element = $(checkbox_id, this.table.fnGetNodes());
 
-            /* Default: swap check status */
-            if (typeof checked === 'undefined')
-                checked = !(element.is(':checked'));
-
             element.attr('checked', checked);
         },
 
         {
             switch(data.request) {
                 case FIELD_REQUEST_ADD:
+                case FIELD_REQUEST_ADD_RESET:
                     this.set_checkbox(data.value, true);
                     break;
                 case FIELD_REQUEST_REMOVE:
+                case FIELD_REQUEST_REMOVE_RESET:
                     this.set_checkbox(data.value, false);
                     break;
-                case FIELD_REQUEST_RESET:
-                    this.set_checkbox(data.value); // swap
-                    break;
                 default:
                     break;
             }
 
         _check_click: function(e) 
         {
+            e.stopPropagation();
 
             var self = e.data;