mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Small improvements in behavior
This commit is contained in:
parent
8b6894808f
commit
b810bdc2f1
1 changed files with 6 additions and 0 deletions
|
@ -54,8 +54,12 @@ function disableOneEvent(event) {
|
||||||
* @return {Number}
|
* @return {Number}
|
||||||
*/
|
*/
|
||||||
function within(number, num1, num2) {
|
function within(number, num1, num2) {
|
||||||
|
if (num2 === undefined) {
|
||||||
|
return number < num1 ? num1 : number;
|
||||||
|
}
|
||||||
const min = Math.min(num1, num2);
|
const min = Math.min(num1, num2);
|
||||||
const max = Math.max(num1, num2);
|
const max = Math.max(num1, num2);
|
||||||
|
console.log(min, max);
|
||||||
if (number < min) {
|
if (number < min) {
|
||||||
return min;
|
return min;
|
||||||
} else if (number > max) {
|
} else if (number > max) {
|
||||||
|
@ -264,6 +268,7 @@ const scrollerFactory = function (frame, options) {
|
||||||
* @return {Void}
|
* @return {Void}
|
||||||
*/
|
*/
|
||||||
self.slideTo = function (newPos, immediate, fullItemPos) {
|
self.slideTo = function (newPos, immediate, fullItemPos) {
|
||||||
|
console.trace();
|
||||||
ensureSizeInfo();
|
ensureSizeInfo();
|
||||||
const pos = self._pos;
|
const pos = self._pos;
|
||||||
|
|
||||||
|
@ -864,6 +869,7 @@ scrollerFactory.prototype.to = function (location, item, immediate) {
|
||||||
this.slideTo(this._pos[location], immediate);
|
this.slideTo(this._pos[location], immediate);
|
||||||
} else {
|
} else {
|
||||||
const itemPos = this.getPos(item);
|
const itemPos = this.getPos(item);
|
||||||
|
console.log(itemPos);
|
||||||
|
|
||||||
if (itemPos) {
|
if (itemPos) {
|
||||||
this.slideTo(itemPos[location], immediate, itemPos);
|
this.slideTo(itemPos[location], immediate, itemPos);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue