Creation du système de base des widgets
This commit is contained in:
parent
8fda06c77f
commit
e61c495cc4
9 changed files with 118 additions and 2 deletions
|
|
@ -1,8 +1,10 @@
|
|||
import "./feature-short-header.js"
|
||||
import FEATURE_WIDGETS from "../feature-widgets/feature-widgets.js"
|
||||
|
||||
const TEMPLATE = document.createElement("template")
|
||||
TEMPLATE.innerHTML = `
|
||||
<camp-feature-short-header class="feature-header" ></camp-feature-short-header>
|
||||
<div class="feature-widgets"></div
|
||||
`
|
||||
|
||||
export class FeatureElement extends HTMLElement {
|
||||
|
|
@ -19,6 +21,14 @@ export class FeatureElement extends HTMLElement {
|
|||
let header = this.querySelector("camp-feature-short-header")
|
||||
header.feature = this.feature
|
||||
header.updateContent()
|
||||
|
||||
let widgetContainer = this.querySelector(".feature-widgets");
|
||||
for(let widgetFn of FEATURE_WIDGETS){
|
||||
let result = widgetFn(this.feature);
|
||||
if(result !== undefined && result !== null){
|
||||
widgetContainer.append(result)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue