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

32 lines
833 B
JavaScript
Raw Normal View History

define(['layoutManager', 'paper-spinner', 'css!./loading'], function (layoutManager) {
2016-02-16 09:15:36 -07:00
return {
show: function () {
var elem = document.querySelector('.docspinner');
if (!elem) {
elem = document.createElement("paper-spinner");
elem.classList.add('docspinner');
if (layoutManager.tv) {
elem.classList.add('tv');
}
2016-02-16 09:15:36 -07:00
document.body.appendChild(elem);
}
elem.active = true;
elem.classList.remove('loadingHide');
},
hide: function () {
var elem = document.querySelector('.docspinner');
if (elem) {
elem.active = false;
elem.classList.add('loadingHide');
}
}
};
});