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

Use getAssetURL() from common

parent 3b11e5b9
Branches
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-person-select-wc-src" src="vpu-person-select.js"></script> <script type="module" id="vpu-person-select-src" src="vpu-person-select.js"></script>
</head> </head>
<body> <body>
......
...@@ -3,7 +3,6 @@ import {html, LitElement} from 'lit-element'; ...@@ -3,7 +3,6 @@ import {html, LitElement} from 'lit-element';
import './person-select.js'; import './person-select.js';
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 {getAssetURL} from "./utils";
class PersonSelectDemo extends LitElement { class PersonSelectDemo extends LitElement {
constructor() { constructor() {
...@@ -26,7 +25,8 @@ class PersonSelectDemo extends LitElement { ...@@ -26,7 +25,8 @@ class PersonSelectDemo extends LitElement {
} }
render() { render() {
const bulmaCSS = getAssetURL(bulmaCSSPath); commonUtils.initAssetBaseURL('vpu-person-select-src');
const bulmaCSS = commonUtils.getAssetURL(bulmaCSSPath);
return html` return html`
<link rel="stylesheet" href="${bulmaCSS}"> <link rel="stylesheet" href="${bulmaCSS}">
......
import $ from 'jquery'; import $ from 'jquery';
import {getAssetURL, findObjectInApiResults} from './utils.js'; import {findObjectInApiResults} from './utils.js';
import select2 from 'select2'; import select2 from 'select2';
import select2LangDe from './i18n/de/select2' import select2LangDe from './i18n/de/select2'
import select2LangEn from './i18n/en/select2' import select2LangEn from './i18n/en/select2'
...@@ -205,8 +205,9 @@ class PersonSelect extends VPULitElementJQuery { ...@@ -205,8 +205,9 @@ class PersonSelect extends VPULitElementJQuery {
} }
render() { render() {
const select2CSS = getAssetURL(select2CSSPath); commonUtils.initAssetBaseURL('vpu-person-select-src');
const bulmaCSS = getAssetURL(bulmaCSSPath); const select2CSS = commonUtils.getAssetURL(select2CSSPath);
const bulmaCSS = commonUtils.getAssetURL(bulmaCSSPath);
return html` return html`
<link rel="stylesheet" href="${bulmaCSS}"> <link rel="stylesheet" href="${bulmaCSS}">
<link rel="stylesheet" href="${select2CSS}"> <link rel="stylesheet" href="${select2CSS}">
......
export const getAssetURL = (path) => {
const elm = document.getElementById('vpu-library-shelving-wc-src');
if (!elm)
return path;
const url = elm.src;
// newer browsers only
//var url = import.meta.url;
return new URL(path, url).href;
};
/** /**
* Finds an object in a JSON result by identifier * Finds an object in a JSON result by identifier
......
auth @ 32b3c1e2
Subproject commit fd7e46df47782d2f4438ed81aff7bfc7f5ddf1d9 Subproject commit 32b3c1e27e0f2d542576cce65d370208ddd95de0
common @ adbdf637
Subproject commit 06dc2079ed19d9ae4762f89dd9eaaec9911b2b13 Subproject commit adbdf63736ba48eaf93ca06f83ee3652b7f85f12
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment