Skip to content

Commit ba57c36

Browse files
committed
Portal.view.learn.MainContainerController: onAppConnect() => activate the first livePreview cmp tab & disable the 2nd one #5282
1 parent b8e2853 commit ba57c36

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

apps/portal/view/learn/LivePreview.mjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@ class LivePreview extends Container {
7171
*/
7272
previewContainer = null
7373

74+
/**
75+
* @returns {Neo.component.Base|null}
76+
*/
77+
get tabContainer() {
78+
return this.getReference('tab-container')
79+
}
80+
7481
/**
7582
* Triggered after the value config got changed
7683
* @param {String|null} value

apps/portal/view/learn/MainContainerController.mjs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,15 @@ class MainContainerController extends Controller {
3939
livePreviewId = me.decodeUri(searchString.substring(1)).id,
4040
livePreview = Neo.getComponent(livePreviewId),
4141
sourceContainer = livePreview.getReference('preview'),
42+
tabContainer = livePreview.tabContainer,
4243
sourceView = sourceContainer.removeAt(0, false);
4344

4445
livePreview.previewContainer = mainView;
45-
mainView.add(sourceView)
46+
mainView.add(sourceView);
47+
48+
tabContainer.activeIndex = 0; // switch to the source view
49+
50+
tabContainer.getTabAtIndex(1).disabled = true
4651
}
4752

4853
/**

0 commit comments

Comments
 (0)