jellyfin-web/dashboard-ui/bower_components/emby-webcomponents/loading/loading-lite.js
2016-04-23 22:43:52 -04:00

31 lines
897 B
JavaScript

define(['MaterialSpinner', 'css!./loading'], function () {
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');
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');
}
}
};
});