mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
merge from dev
This commit is contained in:
parent
8436c7ff3c
commit
db793b9d25
46 changed files with 646 additions and 356 deletions
|
@ -35,8 +35,6 @@ define(function () {
|
|||
|
||||
var url = cssId + '.css';
|
||||
|
||||
var packageName = '';
|
||||
|
||||
if (url.indexOf('http') != 0 && url.indexOf('file:') != 0) {
|
||||
url = config.baseUrl + url;
|
||||
}
|
||||
|
@ -46,10 +44,6 @@ define(function () {
|
|||
|
||||
var link = document.createElement('link');
|
||||
|
||||
if (packageName) {
|
||||
link.setAttribute('data-package', packageName);
|
||||
}
|
||||
|
||||
link.setAttribute('rel', 'stylesheet');
|
||||
link.setAttribute('type', 'text/css');
|
||||
link.onload = load;
|
||||
|
@ -61,18 +55,10 @@ define(function () {
|
|||
}
|
||||
|
||||
window.requireCss = {
|
||||
unloadPackage: function (packageName) {
|
||||
removeStylesheet: function (stylesheet) {
|
||||
|
||||
// Todo: unload css here
|
||||
var stylesheets = document.head.querySelectorAll("link[data-package='" + packageName + "']");
|
||||
for (var i = 0, length = stylesheets.length; i < length; i++) {
|
||||
|
||||
var stylesheet = stylesheets[i];
|
||||
|
||||
console.log('Unloading stylesheet: ' + stylesheet.href);
|
||||
stylesheet.parentNode.removeChild(stylesheet);
|
||||
removeFromLoadHistory(stylesheet.href);
|
||||
}
|
||||
stylesheet.parentNode.removeChild(stylesheet);
|
||||
removeFromLoadHistory(stylesheet.href);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue