mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 19:08:18 -07:00
update library menu
This commit is contained in:
parent
d512595066
commit
727a2e09f2
@ -32,14 +32,14 @@
|
||||
"web-component-tester": "^4.0.0",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"homepage": "https://github.com/PolymerElements/iron-icon",
|
||||
"homepage": "https://github.com/polymerelements/iron-icon",
|
||||
"_release": "1.0.8",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.8",
|
||||
"commit": "f36b38928849ef3853db727faa8c9ef104d611eb"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/iron-icon.git",
|
||||
"_source": "git://github.com/polymerelements/iron-icon.git",
|
||||
"_target": "^1.0.0",
|
||||
"_originalSource": "PolymerElements/iron-icon"
|
||||
"_originalSource": "polymerelements/iron-icon"
|
||||
}
|
72
dashboard-ui/components/scrollthreshold.js
Normal file
72
dashboard-ui/components/scrollthreshold.js
Normal file
@ -0,0 +1,72 @@
|
||||
define(['events'], function (events) {
|
||||
|
||||
function thresholdMonitor(elem, horizontal, lowerTolerance, upperTolerance) {
|
||||
|
||||
var defaultTolerance = horizontal ? (screen.availWidth / 2) : (screen.availHeight / 2);
|
||||
lowerTolerance = lowerTolerance || defaultTolerance;
|
||||
upperTolerance = upperTolerance || defaultTolerance;
|
||||
|
||||
var self = this;
|
||||
var upperTriggered = false;
|
||||
var lowerTriggered = false;
|
||||
|
||||
var scrollSize;
|
||||
|
||||
function getScrollSize() {
|
||||
|
||||
if (!scrollSize) {
|
||||
scrollSize = horizontal ? (elem.scrollWidth - elem.clientWidth) : (elem.scrollHeight - elem.clientHeight);
|
||||
}
|
||||
return scrollSize;
|
||||
}
|
||||
|
||||
function onScroll(e) {
|
||||
|
||||
if (lowerTriggered && upperTriggered) {
|
||||
return;
|
||||
}
|
||||
|
||||
var position = horizontal ? elem.scrollLeft : elem.scrollTop;
|
||||
|
||||
// Detect upper threshold
|
||||
if (!upperTriggered && position < upperTolerance) {
|
||||
upperTriggered = true;
|
||||
events.trigger(self, 'upper-threshold');
|
||||
}
|
||||
// Detect lower threshold
|
||||
if (!lowerTriggered && position >= (getScrollSize() - lowerTolerance)) {
|
||||
lowerTriggered = false;
|
||||
events.trigger(self, 'lower-threshold');
|
||||
}
|
||||
}
|
||||
|
||||
self.reset = function () {
|
||||
self.resetSize();
|
||||
upperTriggered = false;
|
||||
lowerTriggered = false;
|
||||
};
|
||||
|
||||
self.resetSize = function () {
|
||||
scrollSize = null;
|
||||
};
|
||||
|
||||
self.enabled = function (enabled) {
|
||||
|
||||
self.reset();
|
||||
|
||||
if (enabled) {
|
||||
elem.addEventListener('scroll', onScroll, true);
|
||||
} else {
|
||||
elem.removeEventListener('scroll', onScroll, true);
|
||||
}
|
||||
};
|
||||
|
||||
self.enabled(true);
|
||||
|
||||
self.destroy = function () {
|
||||
self.enabled(false);
|
||||
};
|
||||
}
|
||||
|
||||
return thresholdMonitor;
|
||||
});
|
@ -1133,7 +1133,8 @@
|
||||
renderHeader();
|
||||
headerCreated = true;
|
||||
|
||||
if (userRequiresUpdateAfterHeader) {
|
||||
var user = userRequiresUpdateAfterHeader;
|
||||
if (user) {
|
||||
updateUserInHeader(user);
|
||||
}
|
||||
userRequiresUpdateAfterHeader = null;
|
||||
|
@ -1607,6 +1607,7 @@ var AppInfo = {};
|
||||
velocity: bowerPath + "/velocity/velocity.min",
|
||||
tvguide: 'components/tvguide/tvguide',
|
||||
ironCardList: 'components/ironcardlist',
|
||||
scrollThreshold: 'components/scrollthreshold',
|
||||
directorybrowser: 'components/directorybrowser/directorybrowser',
|
||||
collectioneditor: 'components/collectioneditor/collectioneditor',
|
||||
playlisteditor: 'components/playlisteditor/playlisteditor',
|
||||
|
Loading…
Reference in New Issue
Block a user