Skip to content

Commit b34ff49

Browse files
add template replacement logic function to load when valid rec assembled via state
1 parent 41bd9bb commit b34ff49

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/scripts.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,15 @@ function setStateProps(state) {
146146
// function to render "license recommendation",
147147
// if valid license from state.parts and/or state.current
148148
function renderLicenseRec(state) {
149-
document.querySelector('#license-recommendation header h3').textContent = state.props.license;
149+
// document.querySelector('#license-recommendation header h3').textContent = state.props.license;
150+
151+
if (state.props.license != 'unknown' ) {
152+
let license = state.props.license;
153+
let template = document.getElementById(license);
154+
let templateContent = template.content;
155+
document.querySelector('#license-recommendation .license').textContent = '';
156+
document.querySelector('#license-recommendation .license').appendChild(templateContent);
157+
}
150158
}
151159

152160
// function to set default UX states on Steps

0 commit comments

Comments
 (0)