mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update docked tabs
This commit is contained in:
parent
818ee2bcc3
commit
16e66718f9
9 changed files with 147 additions and 80 deletions
|
@ -36,53 +36,21 @@
|
|||
|
||||
elem.innerHTML = html;
|
||||
|
||||
document.body.appendChild(elem);
|
||||
options.appFooter.add(elem);
|
||||
|
||||
return elem;
|
||||
}
|
||||
|
||||
function initHeadRoom(instance, elem) {
|
||||
|
||||
require(["headroom"], function () {
|
||||
|
||||
// construct an instance of Headroom, passing the element
|
||||
var headroom = new Headroom(elem, {
|
||||
// or scroll tolerance per direction
|
||||
tolerance: {
|
||||
down: 20,
|
||||
up: 0
|
||||
},
|
||||
classes: {
|
||||
pinned: 'dockedtabs--pinned',
|
||||
unpinned: 'dockedtabs--unpinned',
|
||||
top: 'dockedtabs--top',
|
||||
notTop: 'dockedtabs--not-top',
|
||||
initial: 'dockedtabs-headroom'
|
||||
}
|
||||
});
|
||||
// initialise
|
||||
headroom.init();
|
||||
|
||||
instance.headroom = headroom;
|
||||
});
|
||||
}
|
||||
|
||||
function dockedTabs(options) {
|
||||
|
||||
var self = this;
|
||||
|
||||
self.element = render(options);
|
||||
|
||||
initHeadRoom(self, self.element);
|
||||
}
|
||||
|
||||
dockedTabs.prototype.destroy = function() {
|
||||
dockedTabs.prototype.destroy = function () {
|
||||
var self = this;
|
||||
|
||||
if (self.headroom) {
|
||||
self.headroom.destroy();
|
||||
}
|
||||
|
||||
self.Element = null;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue