Update News page

This commit is contained in:
Patrick Jentsch
2022-12-12 15:37:33 +01:00
parent 69152f5e6a
commit a413b41dfd
5 changed files with 260 additions and 42 deletions

View File

@ -30,11 +30,11 @@ class RessourceList {
...{pagination: {item: `<li><a class="page" href="#${listElement.id}"></a></li>`}},
...options
}
if ('ressourceMapper' in options) {
if ('ressourceMapper' in options && typeof options.ressourceMapper === 'function') {
this.ressourceMapper = options.ressourceMapper;
delete options.ressourceMapper;
}
if ('initialHtmlGenerator' in options) {
if ('initialHtmlGenerator' in options && typeof options.initialHtmlGenerator === 'function') {
this.initialHtmlGenerator = options.initialHtmlGenerator;
listElement.innerHTML = this.initialHtmlGenerator(listElement.id);
delete options.initialHtmlGenerator;