From 5109e44b596dcfb1b894592b80fee8d2179e96af Mon Sep 17 00:00:00 2001 From: Alex-At-Home Date: Sat, 28 Sep 2019 13:36:36 -0400 Subject: [PATCH] [#65] Add minimal UI support for global cell references for query/status (use JSON still) --- .../view-models/sidebarAppGeneralEditor.js | 14 +++++++++++--- src/frontend/view-models/sidebarAppTableForm.js | 1 - 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/frontend/view-models/sidebarAppGeneralEditor.js b/src/frontend/view-models/sidebarAppGeneralEditor.js index c214104..e218b2e 100644 --- a/src/frontend/view-models/sidebarAppGeneralEditor.js +++ b/src/frontend/view-models/sidebarAppGeneralEditor.js @@ -19,6 +19,7 @@ var GeneralEditor = (function(){ + ` @@ -61,6 +62,7 @@ var GeneralEditor = (function(){ +
@@ -110,6 +112,8 @@ var GeneralEditor = (function(){ var querySource = Util.getJson(json, ["common", "query", "source"]) || "none" if (querySource == "none") { $(`#querybar_${tableType}_${index}`).val("none") + } else if (querySource == "global") { + $(`#querybar_${tableType}_${index}`).val("global") } else { var localQueryPos = Util.getJson(json, ["common", "query", "local", "position"]) || "none" $(`#querybar_${tableType}_${index}`).val(localQueryPos) @@ -162,9 +166,13 @@ var GeneralEditor = (function(){ var thisValue = this.value Util.updateRawJsonNow(globalEditor, function(currJson) { var query = Util.getOrPutJsonObj(currJson, [ "common", "query" ]) - query.source = (thisValue == "none") ? "none" : "local" // (only supported option currently) - var localQuery = Util.getOrPutJsonObj(currJson, [ "common", "query", "local" ]) - localQuery.position = thisValue + if (("none" == thisValue) || ("global" == thisValue)) { + query.source = thisValue + } else { + query.source = "local" + var localQuery = Util.getOrPutJsonObj(currJson, [ "common", "query", "local" ]) + localQuery.position = thisValue + } }) }) } diff --git a/src/frontend/view-models/sidebarAppTableForm.js b/src/frontend/view-models/sidebarAppTableForm.js index c4623db..1f1deed 100644 --- a/src/frontend/view-models/sidebarAppTableForm.js +++ b/src/frontend/view-models/sidebarAppTableForm.js @@ -103,7 +103,6 @@ var TableForm = (function() { ` }//(endif standaloneEdit) - var panelHeader = '' var panelHeader = '' var panelInOrOut = standaloneEdit ? 'in' : 'out' if (!standaloneEdit) {