jellyfin-web/dashboard-ui/bower_components/emby-webcomponents/loading/loading-lite.js
2016-03-23 00:07:24 -04:00

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');
}
}
};
});