diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/tab-context.js b/packages/node_modules/@node-red/editor-client/src/js/ui/tab-context.js
index 6cb034ccc..2c56786c8 100644
--- a/packages/node_modules/@node-red/editor-client/src/js/ui/tab-context.js
+++ b/packages/node_modules/@node-red/editor-client/src/js/ui/tab-context.js
@@ -18,8 +18,6 @@ RED.sidebar.context = (function() {
var content;
var sections;
- var localCache = {};
-
var flowAutoRefresh;
var nodeAutoRefresh;
var nodeSection;
@@ -27,6 +25,8 @@ RED.sidebar.context = (function() {
var flowSection;
var globalSection;
+ const expandedPaths = {}
+
var currentNode;
var currentFlow;
@@ -212,14 +212,41 @@ RED.sidebar.context = (function() {
var l = keys.length;
for (var i = 0; i < l; i++) {
sortedData[keys[i]].forEach(function(v) {
- var k = keys[i];
- var l2 = sortedData[k].length;
- var propRow = $('
').appendTo(container);
- var obj = $(propRow.children()[0]);
+ const k = keys[i];
+ let payload = v.msg;
+ let format = v.format;
+ const tools = $('');
+ expandedPaths[id + "." + k] = expandedPaths[id + "." + k] || new Set()
+ const objectElementOptions = {
+ typeHint: format,
+ sourceId: id + "." + k,
+ tools,
+ path: k,
+ rootPath: k,
+ exposeApi: true,
+ ontoggle: function(path,state) {
+ path = path.substring(k.length+1)
+ if (state) {
+ expandedPaths[id+"."+k].add(path)
+ } else {
+ // if 'a' has been collapsed, we want to remove 'a.b' and 'a[0]...' from the set
+ // of collapsed paths
+ for (let expandedPath of expandedPaths[id+"."+k]) {
+ if (expandedPath.startsWith(path+".") || expandedPath.startsWith(path+"[")) {
+ expandedPaths[id+"."+k].delete(expandedPath)
+ }
+ }
+ expandedPaths[id+"."+k].delete(path)
+ }
+ },
+ expandPaths: [ ...expandedPaths[id+"."+k] ].sort(),
+ expandLeafNodes: true
+ }
+ const propRow = $('