From: Jordan Augé Date: Tue, 8 Jul 2014 08:33:45 +0000 (+0200) Subject: fixing querytable field_state_change events handler X-Git-Tag: myslice-1.1~39 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=e05236fa7fc990e54389b6255c5f9232c9260159;p=unfold.git fixing querytable field_state_change events handler --- diff --git a/manifoldapi/static/js/manifold.js b/manifoldapi/static/js/manifold.js index 2108c651..c031a237 100644 --- a/manifoldapi/static/js/manifold.js +++ b/manifoldapi/static/js/manifold.js @@ -1697,7 +1697,7 @@ var manifold = { /* Inform the parent query: important for update */ new_data = { state : STATE_SET, - key : this._get_query_path(query_ext), + key : '', //this._get_query_path(query_ext), op : STATE_SET_ADD, value : data.value, }; @@ -1748,7 +1748,7 @@ var manifold = { /* Inform the parent query: important for update */ new_data = { state : STATE_SET, - key : this._get_query_path(query_ext), + key : '', //this._get_query_path(query_ext), op : STATE_SET_REMOVE, value : data.value, }; diff --git a/plugins/querytable/static/js/querytable.js b/plugins/querytable/static/js/querytable.js index eb5f834d..4b9e5461 100644 --- a/plugins/querytable/static/js/querytable.js +++ b/plugins/querytable/static/js/querytable.js @@ -455,26 +455,26 @@ QUERYTABLE_BGCOLOR_REMOVED = 2; switch(data.state) { case STATE_SET: - switch(data.value) { + switch(data.op) { case STATE_SET_IN: case STATE_SET_IN_SUCCESS: case STATE_SET_OUT_FAILURE: - this.set_checkbox_from_data(data.key, true); - this.set_bgcolor(data.key, QUERYTABLE_BGCOLOR_RESET); + this.set_checkbox_from_data(data.value, true); + this.set_bgcolor(data.value, QUERYTABLE_BGCOLOR_RESET); break; case STATE_SET_OUT: case STATE_SET_OUT_SUCCESS: case STATE_SET_IN_FAILURE: - this.set_checkbox_from_data(data.key, false); - this.set_bgcolor(data.key, QUERYTABLE_BGCOLOR_RESET); + this.set_checkbox_from_data(data.value, false); + this.set_bgcolor(data.value, QUERYTABLE_BGCOLOR_RESET); break; case STATE_SET_IN_PENDING: this.set_checkbox_from_data(data.key, true); - this.set_bgcolor(data.key, QUERYTABLE_BGCOLOR_ADDED); + this.set_bgcolor(data.value, QUERYTABLE_BGCOLOR_ADDED); break; case STATE_SET_OUT_PENDING: this.set_checkbox_from_data(data.key, false); - this.set_bgcolor(data.key, QUERYTABLE_BGCOLOR_REMOVED); + this.set_bgcolor(data.value, QUERYTABLE_BGCOLOR_REMOVED); break; } break;