mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Use static imports for html templates
This commit is contained in:
parent
75e1fc4605
commit
d8f2cc1245
31 changed files with 1010 additions and 1041 deletions
|
@ -1,5 +1,6 @@
|
|||
import './emby-progressring.css';
|
||||
import 'webcomponents.js/webcomponents-lite';
|
||||
import template from './emby-progressring.template.html';
|
||||
|
||||
/* eslint-disable indent */
|
||||
|
||||
|
@ -9,28 +10,26 @@ import 'webcomponents.js/webcomponents-lite';
|
|||
this.classList.add('progressring');
|
||||
const instance = this;
|
||||
|
||||
import('./emby-progressring.template.html').then(({default: template}) => {
|
||||
instance.innerHTML = template;
|
||||
instance.innerHTML = template;
|
||||
|
||||
if (window.MutationObserver) {
|
||||
// create an observer instance
|
||||
const observer = new MutationObserver(function (mutations) {
|
||||
mutations.forEach(function (mutation) {
|
||||
instance.setProgress(parseFloat(instance.getAttribute('data-progress') || '0'));
|
||||
});
|
||||
if (window.MutationObserver) {
|
||||
// create an observer instance
|
||||
const observer = new MutationObserver(function (mutations) {
|
||||
mutations.forEach(function (mutation) {
|
||||
instance.setProgress(parseFloat(instance.getAttribute('data-progress') || '0'));
|
||||
});
|
||||
});
|
||||
|
||||
// configuration of the observer:
|
||||
const config = { attributes: true, childList: false, characterData: false };
|
||||
// configuration of the observer:
|
||||
const config = { attributes: true, childList: false, characterData: false };
|
||||
|
||||
// pass in the target node, as well as the observer options
|
||||
observer.observe(instance, config);
|
||||
// pass in the target node, as well as the observer options
|
||||
observer.observe(instance, config);
|
||||
|
||||
instance.observer = observer;
|
||||
}
|
||||
instance.observer = observer;
|
||||
}
|
||||
|
||||
instance.setProgress(parseFloat(instance.getAttribute('data-progress') || '0'));
|
||||
});
|
||||
instance.setProgress(parseFloat(instance.getAttribute('data-progress') || '0'));
|
||||
};
|
||||
|
||||
EmbyProgressRing.setProgress = function (progress) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue