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

Use getAssetURL from common

parent 2116ec72
No related branches found
No related tags found
No related merge requests found
......@@ -3,9 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script nomodule src="local/vpu-data-table-view/nomodule.js"></script>
<script type="module" src="local/vpu-data-table-view/spinner.js"></script>
<script type="module" id="vpu-library-app-src" src="vpu-data-table-view.js"></script>
<script type="module" id="vpu-data-table-view-src" src="vpu-data-table-view.js"></script>
</head>
<body>
......
......@@ -8,7 +8,6 @@ import de from '../assets/datatables/i18n/German';
import en from '../assets/datatables/i18n/English';
import * as commonUtils from 'vpu-common/utils';
import {getAssetURL} from "./utils";
import * as utils from "./utils";
import bulmaCSSPath from "bulma/css/bulma.min.css";
......@@ -112,9 +111,10 @@ class DataTableView extends LitElement {
}
render() {
const bulmaCSS = utils.getAssetURL(bulmaCSSPath);
let dt_css = getAssetURL('local/vpu-data-table-view/css/jquery.dataTables.min.css');
let rs_css = getAssetURL('local/vpu-data-table-view/css/responsive.dataTables.css');
commonUtils.initAssetBaseURL('vpu-data-table-view-src');
const bulmaCSS = commonUtils.getAssetURL(bulmaCSSPath);
let dt_css = commonUtils.getAssetURL('local/vpu-data-table-view/css/jquery.dataTables.min.css');
let rs_css = commonUtils.getAssetURL('local/vpu-data-table-view/css/responsive.dataTables.css');
return html`
<link rel="stylesheet" href="${bulmaCSS}">
......
......@@ -5,7 +5,6 @@ import {i18n} from './i18n';
import {html, LitElement} from 'lit-element';
import * as commonUtils from 'vpu-common/utils';
import bulmaCSSPath from "bulma/css/bulma.min.css";
import * as utils from "./utils";
class DataTableViewDemo extends LitElement {
constructor() {
......@@ -96,7 +95,8 @@ class DataTableViewDemo extends LitElement {
}
render() {
const bulmaCSS = utils.getAssetURL(bulmaCSSPath);
commonUtils.initAssetBaseURL('vpu-data-table-view-src');
const bulmaCSS = commonUtils.getAssetURL(bulmaCSSPath);
return html`
<link rel="stylesheet" href="${bulmaCSS}">
<style>
......
import vars from './vars.js';
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;
}
export const getAPiUrl = function(path = "", withPrefix = true) {
return vars.apiBaseUrl + (withPrefix ? vars.apiUrlPrefix : "") + path;
}
......
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.
Finish editing this message first!
Please register or to comment