mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 19:08:18 -07:00
fix merge conflicts
This commit is contained in:
parent
9e0b1557af
commit
b008aa430b
@ -1 +1 @@
|
||||
define(["scroller","dom","layoutManager","registerElement"],function(scroller,dom,layoutManager){"use strict";function initCenterFocus(elem,scrollerInstance,selector){var classNames=selector.split(",");dom.addEventListener(elem,"focus",function(e){var focused=dom.parentWithClass(e.target,classNames);focused&&scrollerInstance.toCenter(focused)},{capture:!0,passive:!0})}var ScrollerProtoType=Object.create(HTMLDivElement.prototype);ScrollerProtoType.createdCallback=function(){this.classList.add("emby-scroller")},ScrollerProtoType.scrollToBeginning=function(){this.scroller&&this.scroller.slideTo(0,!0)},ScrollerProtoType.scrollToPosition=function(pos,immediate){this.scroller&&this.scroller.slideTo(pos,immediate)},ScrollerProtoType.getScrollPosition=function(){if(this.scroller)return this.scroller.getScrollPosition()},ScrollerProtoType.attachedCallback=function(){var horizontal="false"!==this.getAttribute("data-horizontal"),slider=this.querySelector(".scrollSlider");horizontal&&(slider.style["white-space"]="nowrap");var frameSizeElement,frameSizeConfig=this.getAttribute("data-framesize");"matchparent"===frameSizeConfig?frameSizeElement=this.parentNode:"matchgrandparent"===frameSizeConfig&&(frameSizeElement=this.parentNode.parentNode);var options={horizontal:horizontal,mouseDragging:1,mouseWheel:"false"!==this.getAttribute("data-mousewheel"),touchDragging:1,slidee:slider,scrollBy:200,speed:300,elasticBounds:1,dragHandle:1,scrollWidth:5e5,frameSizeElement:frameSizeElement,autoImmediate:!0,skipSlideToWhenVisible:"true"===this.getAttribute("data-skipfocuswhenvisible")},self=this;setTimeout(function(){self.scroller=new scroller(self,options),self.scroller.init();var centerFocus=self.getAttribute("data-centerfocus");centerFocus&&layoutManager.tv&&initCenterFocus(self,self.scroller,centerFocus)},0)},ScrollerProtoType.detachedCallback=function(){var scrollerInstance=this.scroller;scrollerInstance&&(scrollerInstance.destroy(),this.scroller=null)},document.registerElement("emby-scroller",{prototype:ScrollerProtoType,extends:"div"})});
|
||||
define(["scroller","dom","layoutManager","inputManager","focusManager","registerElement"],function(scroller,dom,layoutManager,inputManager,focusManager){"use strict";function initCenterFocus(elem,scrollerInstance,selector){var classNames=selector.split(",");dom.addEventListener(elem,"focus",function(e){var focused=dom.parentWithClass(e.target,classNames);focused&&scrollerInstance.toCenter(focused)},{capture:!0,passive:!0})}function onInputCommand(e){var cmd=e.detail.command;"home"===cmd?(focusManager.focusFirst(this,"."+this.getAttribute("data-navcommands")),e.preventDefault(),e.stopPropagation()):"end"===cmd?(focusManager.focusLast(this,"."+this.getAttribute("data-navcommands")),e.preventDefault(),e.stopPropagation()):"pageup"===cmd?(focusManager.moveFocus(e.target,this,"."+this.getAttribute("data-navcommands"),-12),e.preventDefault(),e.stopPropagation()):"pagedown"===cmd&&(focusManager.moveFocus(e.target,this,"."+this.getAttribute("data-navcommands"),12),e.preventDefault(),e.stopPropagation())}var ScrollerProtoType=Object.create(HTMLDivElement.prototype);ScrollerProtoType.createdCallback=function(){this.classList.add("emby-scroller")},ScrollerProtoType.scrollToBeginning=function(){this.scroller&&this.scroller.slideTo(0,!0)},ScrollerProtoType.toStart=function(elem,immediate){this.scroller&&this.scroller.toStart(elem,immediate)},ScrollerProtoType.scrollToPosition=function(pos,immediate){this.scroller&&this.scroller.slideTo(pos,immediate)},ScrollerProtoType.getScrollPosition=function(){if(this.scroller)return this.scroller.getScrollPosition()},ScrollerProtoType.attachedCallback=function(){this.getAttribute("data-navcommands")&&inputManager.on(this,onInputCommand);var horizontal="false"!==this.getAttribute("data-horizontal"),slider=this.querySelector(".scrollSlider");horizontal&&(slider.style["white-space"]="nowrap");var options={horizontal:horizontal,mouseDragging:1,mouseWheel:"false"!==this.getAttribute("data-mousewheel"),touchDragging:1,slidee:slider,scrollBy:200,speed:horizontal?300:270,elasticBounds:1,dragHandle:1,scrollWidth:5e6,autoImmediate:!0,skipSlideToWhenVisible:"true"===this.getAttribute("data-skipfocuswhenvisible"),dispatchScrollEvent:"true"===this.getAttribute("data-scrollevent")},self=this;setTimeout(function(){self.scroller=new scroller(self,options),self.scroller.init();var centerFocus=self.getAttribute("data-centerfocus");centerFocus&&layoutManager.tv&&initCenterFocus(self,self.scroller,centerFocus)},0)},ScrollerProtoType.detachedCallback=function(){this.getAttribute("data-navcommands")&&inputManager.off(this,onInputCommand);var scrollerInstance=this.scroller;scrollerInstance&&(scrollerInstance.destroy(),this.scroller=null)},document.registerElement("emby-scroller",{prototype:ScrollerProtoType,extends:"div"})});
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user