Skip to content
Snippets Groups Projects
Commit d94a4d1a authored by Neuber, Eugen Ramon's avatar Neuber, Eugen Ramon :speech_balloon: Committed by Reiter, Christoph
Browse files

Lazy load for kb texts

parent c37971e5
No related branches found
No related tags found
No related merge requests found
......@@ -40,6 +40,7 @@ class VPUKnowledgeBaseWebPageElementView extends VPULitElement {
};
}
/*
connectedCallback() {
super.connectedCallback();
const that = this;
......@@ -49,8 +50,10 @@ class VPUKnowledgeBaseWebPageElementView extends VPULitElement {
// encodeURIComponent(commonUtils.base64EncodeUnicode(encodeURIComponent(that.value)));
// });
// disabled, load first on toggle to visible
window.addEventListener("vpu-auth-init", () => that.loadWebPageElement());
}
*/
/**
* Loads the data from the web page element
......@@ -113,7 +116,7 @@ class VPUKnowledgeBaseWebPageElementView extends VPULitElement {
case "lang":
case "value":
case "entry-point-url":
this.loadWebPageElement();
this.html = '';
break;
case "text":
this.class = this.text !== '' ? 'has-text' : '';
......@@ -129,12 +132,15 @@ class VPUKnowledgeBaseWebPageElementView extends VPULitElement {
const img = e.target;
const d = element.style.display;
if(d === '' || d === 'none') {
element.style.display = 'flex';
element.style.display = 'block';
img.src = this.eyeClose;
} else {
element.style.display = 'none';
img.src = this.eyeOpen;
}
if (this.html === '' && element.style.display !== 'none') {
this.loadWebPageElement();
}
}
render() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment