mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 19:38:20 -07:00
35 lines
1.0 KiB
JavaScript
35 lines
1.0 KiB
JavaScript
define(['layoutManager', 'MaterialSpinner', 'css!./loading'], function (layoutManager) {
|
|
|
|
return {
|
|
show: function () {
|
|
var elem = document.querySelector('.docspinner');
|
|
|
|
if (!elem) {
|
|
|
|
elem = document.createElement("div");
|
|
elem.classList.add('docspinner');
|
|
elem.classList.add('mdl-spinner');
|
|
elem.classList.add('mdl-js-spinner');
|
|
|
|
if (layoutManager.tv) {
|
|
elem.classList.add('tv');
|
|
}
|
|
|
|
document.body.appendChild(elem);
|
|
componentHandler.upgradeElement(elem, 'MaterialSpinner');
|
|
}
|
|
|
|
elem.classList.add('is-active');
|
|
elem.classList.remove('loadingHide');
|
|
},
|
|
hide: function () {
|
|
var elem = document.querySelector('.docspinner');
|
|
|
|
if (elem) {
|
|
|
|
elem.classList.remove('is-active');
|
|
elem.classList.add('loadingHide');
|
|
}
|
|
}
|
|
};
|
|
}); |