Skip to content

Commit 982886c

Browse files
adding on change handler to fix rendering problem (#189)
1 parent 18d6946 commit 982886c

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

webui/src/js/viewModels/ingress-code-view.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,14 @@ function(accUtils, ko, i18n, project, IngressInstallScriptGenerator, IngressRout
6262
];
6363
this.subviewsDP = new ArrayDataProvider(this.subviews, {keyAttributes: 'id'});
6464
this.selectedSubview = ko.observable('installScript');
65+
this.selectedSubviewValueChangedHandler = (event) => {
66+
this.selectedSubview(event.detail.value);
67+
this.renderScript(event.detail.value);
68+
};
6569

66-
this.selectedSubview.subscribe((subview) => {
67-
this.renderScript(subview);
68-
});
70+
// this.selectedSubview.subscribe((subview) => {
71+
// this.renderScript(subview);
72+
// });
6973

7074
this.shellScriptType = ko.observable(IngressInstallScriptGenerator.getDefaultScriptingLanguage());
7175
const shellScriptTypes = [

webui/src/js/views/ingress-code-view.html

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
<oj-switcher id="codeviews"
1818
class="wkt-code-view-switcher"
19+
on-value-changed="[[selectedSubviewValueChangedHandler]]"
1920
value="{{selectedSubview}}">
2021

2122
<div slot="installScript" class="oj-panel wkt-code-view-platform-frame">

0 commit comments

Comments
 (0)