mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 11:28:23 -07:00
56 lines
1.2 KiB
JavaScript
56 lines
1.2 KiB
JavaScript
define(['css!./appfooter'], function () {
|
|
|
|
function render(options) {
|
|
|
|
var elem = document.createElement('div');
|
|
|
|
elem.classList.add('appfooter');
|
|
|
|
document.body.appendChild(elem);
|
|
|
|
return elem;
|
|
}
|
|
|
|
function initHeadRoom(instance, elem) {
|
|
|
|
require(["headroom-window"], function (headroom) {
|
|
|
|
self.headroom = headroom;
|
|
headroom.add(elem);
|
|
});
|
|
}
|
|
|
|
function appFooter(options) {
|
|
|
|
var self = this;
|
|
|
|
self.element = render(options);
|
|
|
|
self.add = function (elem) {
|
|
self.element.appendChild(elem);
|
|
};
|
|
|
|
self.insert = function (elem) {
|
|
if (typeof elem === 'string') {
|
|
self.element.insertAdjacentHTML('afterbegin', elem);
|
|
} else {
|
|
self.element.insertBefore(elem, self.element.firstChild);
|
|
}
|
|
};
|
|
|
|
initHeadRoom(self, self.element);
|
|
}
|
|
|
|
appFooter.prototype.destroy = function () {
|
|
var self = this;
|
|
|
|
if (self.headroom) {
|
|
self.headroom.remove(self.element);
|
|
self.headroom = null;
|
|
}
|
|
|
|
self.element = null;
|
|
};
|
|
|
|
return appFooter;
|
|
}); |