From e05236fa7fc990e54389b6255c5f9232c9260159 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jordan=20Aug=C3=A9?= Date: Tue, 8 Jul 2014 10:33:45 +0200 Subject: [PATCH] fixing querytable field_state_change events handler --- manifoldapi/static/js/manifold.js | 4 ++-- plugins/querytable/static/js/querytable.js | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) 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; -- 2.47.0