From 5d4889e8a1ba0ad0f14e25914fa51bcb6415fcf4 Mon Sep 17 00:00:00 2001 From: Brenton House Date: Fri, 21 Feb 2020 10:53:23 -0600 Subject: [PATCH] add support for widgets in tabs --- Alloy/commands/compile/parsers/Alloy.Require.js | 7 ++++++- Alloy/commands/compile/parsers/Ti.UI.Tab.js | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Alloy/commands/compile/parsers/Alloy.Require.js b/Alloy/commands/compile/parsers/Alloy.Require.js index cfcd713ac..a94e04ce7 100755 --- a/Alloy/commands/compile/parsers/Alloy.Require.js +++ b/Alloy/commands/compile/parsers/Alloy.Require.js @@ -130,11 +130,16 @@ function parse(node, state, args) { state ) + ')'; let parent = { symbol: args.symbol }; - if (args.parent.symbol && !state.templateObject && !state.androidMenu) { + if (args.parent.symbol && !state.templateObject && !state.androidMenu && !state.insideContainer) { code += ';\n' + args.symbol + '.setParent(' + args.parent.symbol + ');\n'; parent = { symbol: args.symbol + '.getViewEx({recurse:true})' }; + } else if ( state.insideContainer ) { + code += ';\n'; + parent = { + symbol: args.symbol + '.getViewEx({recurse:true})' + }; } else { code += '.getViewEx({recurse:true});\n'; } diff --git a/Alloy/commands/compile/parsers/Ti.UI.Tab.js b/Alloy/commands/compile/parsers/Ti.UI.Tab.js index 91303d893..f5492bcdd 100755 --- a/Alloy/commands/compile/parsers/Ti.UI.Tab.js +++ b/Alloy/commands/compile/parsers/Ti.UI.Tab.js @@ -26,6 +26,7 @@ function parse(node, state, args) { if (theNode) { code += CU.generateNodeExtended(child, state, { parent: {}, + insideContainer: true, post: function(node, state, args) { windowSymbol = state.parent.symbol; }