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

Use getAssetURL() from common

parent c1d34613
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@
<html>
<head>
<meta charset="UTF-8">
<script type="module" id="vpu-auth-wc-src" src="bundle.js"></script>
<script type="module" id="vpu-auth-src" src="bundle.js"></script>
</head>
<body>
......
export const getAssetURL = (path) => {
const elm = document.getElementById('vpu-library-app-src');
if (!elm)
return path;
const url = elm.src;
// newer browsers only
//var url = import.meta.url;
return new URL(path, url).href;
};
......@@ -3,7 +3,6 @@ import {html, LitElement} from 'lit-element';
import './vpu-auth';
import * as commonUtils from 'vpu-common/utils';
import bulmaCSSPath from "bulma/css/bulma.min.css";
import * as utils from "./utils";
class AuthDemo extends LitElement {
constructor() {
......@@ -28,7 +27,8 @@ class AuthDemo extends LitElement {
}
render() {
const bulmaCSS = utils.getAssetURL(bulmaCSSPath);
commonUtils.initAssetBaseURL('vpu-auth-src');
const bulmaCSS = commonUtils.getAssetURL(bulmaCSSPath);
return html`
<link rel="stylesheet" href="${bulmaCSS}">
......
......@@ -4,7 +4,6 @@ import JSONLD from 'vpu-common/jsonld'
import * as commonUtils from 'vpu-common/utils';
import 'vpu-common/vpu-icon.js';
import bulmaCSSPath from "bulma/css/bulma.min.css";
import * as utils from "./utils";
/**
* Keycloak auth web component
......@@ -298,7 +297,8 @@ class VPUAuth extends LitElement {
}
render() {
const bulmaCSS = utils.getAssetURL(bulmaCSSPath);
commonUtils.initAssetBaseURL('vpu-auth-src');
const bulmaCSS = commonUtils.getAssetURL(bulmaCSSPath);
return html`
<link rel="stylesheet" href="${bulmaCSS}">
......
common @ adbdf637
Subproject commit 91947464b55c79c5b0aa2188f512e08ebc0be612
Subproject commit adbdf63736ba48eaf93ca06f83ee3652b7f85f12
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