Skip to content
Snippets Groups Projects
Commit 96360741 authored by Reiter, Christoph's avatar Reiter, Christoph :snake:
Browse files

Use getAssetURL from common

parent 74d209bf
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<html> <html>
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<script type="module" id="vpu-knowledge-base-web-page-element-view-wc-src" src="bundle.js"></script> <script type="module" id="vpu-knowledge-base-web-page-element-view-src" src="bundle.js"></script>
</head> </head>
<style> <style>
vpu-knowledge-base-web-page-element-view-demo { vpu-knowledge-base-web-page-element-view-demo {
......
...@@ -4,7 +4,6 @@ import 'vpu-auth'; ...@@ -4,7 +4,6 @@ import 'vpu-auth';
import './vpu-kb-wpe-view'; import './vpu-kb-wpe-view';
import * as commonUtils from 'vpu-common/utils'; import * as commonUtils from 'vpu-common/utils';
import bulmaCSSPath from "bulma/css/bulma.min.css"; import bulmaCSSPath from "bulma/css/bulma.min.css";
import * as utils from "./utils";
class KnowledgeBaseWebPageElementViewDemo extends LitElement { class KnowledgeBaseWebPageElementViewDemo extends LitElement {
constructor() { constructor() {
...@@ -29,7 +28,8 @@ class KnowledgeBaseWebPageElementViewDemo extends LitElement { ...@@ -29,7 +28,8 @@ class KnowledgeBaseWebPageElementViewDemo extends LitElement {
} }
render() { render() {
const bulmaCSS = utils.getAssetURL(bulmaCSSPath); commonUtils.initAssetBaseURL('vpu-knowledge-base-web-page-element-view-src');
const bulmaCSS = commonUtils.getAssetURL(bulmaCSSPath);
return html` return html`
<link rel="stylesheet" href="${bulmaCSS}"> <link rel="stylesheet" href="${bulmaCSS}">
<style> <style>
......
export const getAssetURL = (path) => {
const elm = document.getElementById('vpu-knowledge-base-web-page-element-view-wc-src');
if (!elm)
return path;
const url = elm.src;
// newer browsers only
//var url = import.meta.url;
return new URL(path, url).href;
};
...@@ -6,7 +6,6 @@ import "vpu-common/vpu-mini-spinner.js"; ...@@ -6,7 +6,6 @@ import "vpu-common/vpu-mini-spinner.js";
import * as commonUtils from "vpu-common/utils"; import * as commonUtils from "vpu-common/utils";
import {unsafeHTML} from 'lit-html/directives/unsafe-html.js'; import {unsafeHTML} from 'lit-html/directives/unsafe-html.js';
import bulmaCSSPath from "bulma/css/bulma.min.css"; import bulmaCSSPath from "bulma/css/bulma.min.css";
import * as utils from "./utils";
/** /**
* KnowledgeBaseWebPageElementView web component * KnowledgeBaseWebPageElementView web component
...@@ -156,8 +155,8 @@ class VPUKnowledgeBaseWebPageElementView extends VPULitElement { ...@@ -156,8 +155,8 @@ class VPUKnowledgeBaseWebPageElementView extends VPULitElement {
} }
render() { render() {
//<link rel="stylesheet" href="${this.css}"> commonUtils.initAssetBaseURL('vpu-knowledge-base-web-page-element-view-src');
const bulmaCSS = utils.getAssetURL(bulmaCSSPath); const bulmaCSS = commonUtils.getAssetURL(bulmaCSSPath);
return html` return html`
<link rel="stylesheet" href="${bulmaCSS}"> <link rel="stylesheet" href="${bulmaCSS}">
<style> <style>
......
auth @ 32b3c1e2
Subproject commit 33f040f4a2cedef5ea468f88dbd93210277bb67e Subproject commit 32b3c1e27e0f2d542576cce65d370208ddd95de0
common @ adbdf637
Subproject commit 5e3da6e22fd0d14b95fbc032d385c020ae47fba7 Subproject commit adbdf63736ba48eaf93ca06f83ee3652b7f85f12
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment