1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
jellyfin-web/src/components/loading/loading-legacy.js

33 lines
722 B
JavaScript
Raw Normal View History

define(['require', 'css!./loading-legacy'], function (require) {
'use strict';
2018-10-23 01:05:09 +03:00
var loadingElem;
2018-10-23 01:05:09 +03:00
return {
show: function () {
2018-10-23 01:05:09 +03:00
var elem = loadingElem;
if (!elem) {
elem = document.createElement("img");
elem.src = require.toUrl('.').split('?')[0] + '/loader2.gif';
loadingElem = elem;
elem.classList.add('loading-spinner');
document.body.appendChild(elem);
}
elem.classList.remove('hide');
2018-10-23 01:05:09 +03:00
},
hide: function () {
2018-10-23 01:05:09 +03:00
var elem = loadingElem;
if (elem) {
elem.classList.add('hide');
}
2018-10-23 01:05:09 +03:00
}
};
2018-10-23 01:05:09 +03:00
});