jellyfin-web/dashboard-ui/bower_components/emby-webcomponents/loading/loading-lite.js

35 lines
1.0 KiB
JavaScript
Raw Normal View History

2016-03-22 21:07:24 -07:00
define(['layoutManager', 'MaterialSpinner', 'css!./loading'], function (layoutManager) {
2016-03-09 10:40:22 -07:00
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');
}
}
};
});