mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 11:28:23 -07:00
36 lines
2.2 KiB
JavaScript
36 lines
2.2 KiB
JavaScript
|
define(['css!./loading-legacy'], function () {
|
||
|
|
||
|
var loadingElem;
|
||
|
|
||
|
return {
|
||
|
show: function () {
|
||
|
var elem = loadingElem;
|
||
|
|
||
|
if (!elem) {
|
||
|
|
||
|
elem = document.createElement("div");
|
||
|
loadingElem = elem;
|
||
|
|
||
|
elem.classList.add('docspinner');
|
||
|
elem.classList.add('mdl-spinner');
|
||
|
elem.classList.add('mdl-js-spinner');
|
||
|
|
||
|
elem.innerHTML = '<div class="mdl-spinner__layer mdl-spinner__layer-1"><div class="mdl-spinner__circle-clipper mdl-spinner__left"><div class="mdl-spinner__circle"></div></div><div class="mdl-spinner__gap-patch"><div class="mdl-spinner__circle"></div></div><div class="mdl-spinner__circle-clipper mdl-spinner__right"><div class="mdl-spinner__circle"></div></div></div><div class="mdl-spinner__layer mdl-spinner__layer-2"><div class="mdl-spinner__circle-clipper mdl-spinner__left"><div class="mdl-spinner__circle"></div></div><div class="mdl-spinner__gap-patch"><div class="mdl-spinner__circle"></div></div><div class="mdl-spinner__circle-clipper mdl-spinner__right"><div class="mdl-spinner__circle"></div></div></div><div class="mdl-spinner__layer mdl-spinner__layer-3"><div class="mdl-spinner__circle-clipper mdl-spinner__left"><div class="mdl-spinner__circle"></div></div><div class="mdl-spinner__gap-patch"><div class="mdl-spinner__circle"></div></div><div class="mdl-spinner__circle-clipper mdl-spinner__right"><div class="mdl-spinner__circle"></div></div></div><div class="mdl-spinner__layer mdl-spinner__layer-4"><div class="mdl-spinner__circle-clipper mdl-spinner__left"><div class="mdl-spinner__circle"></div></div><div class="mdl-spinner__gap-patch"><div class="mdl-spinner__circle"></div></div><div class="mdl-spinner__circle-clipper mdl-spinner__right"><div class="mdl-spinner__circle"></div></div></div>';
|
||
|
|
||
|
document.body.appendChild(elem);
|
||
|
}
|
||
|
|
||
|
elem.classList.add('is-active');
|
||
|
elem.classList.remove('loadingHide');
|
||
|
},
|
||
|
hide: function () {
|
||
|
var elem = loadingElem;
|
||
|
|
||
|
if (elem) {
|
||
|
|
||
|
elem.classList.remove('is-active');
|
||
|
elem.classList.add('loadingHide');
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
});
|