@redocly/graphql-docs
Version:
Redocly GraphQL docs
2 lines (1 loc) • 1.19 kB
JavaScript
var p=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var T=Object.prototype.hasOwnProperty;var a=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of d(t))!T.call(e,o)&&o!==s&&p(e,o,{get:()=>t[o],enumerable:!(i=c(t,o))||i.enumerable});return e};var g=e=>a(p({},"__esModule",{value:!0}),e);var L={};module.exports=g(L);typeof Element<"u"&&!Element.prototype.scrollIntoViewIfNeeded&&(Element.prototype.scrollIntoViewIfNeeded=function(e){e=arguments.length===0?!0:!!e;const t=this.parentNode,s=window.getComputedStyle(t,void 0),i=parseInt(s.getPropertyValue("border-top-width"),10),o=parseInt(s.getPropertyValue("border-left-width"),10);if(t){const f=this.offsetTop-t.offsetTop<t.scrollTop,l=this.offsetTop-t.offsetTop+this.clientHeight-i>t.scrollTop+t.clientHeight,n=this.offsetLeft-t.offsetLeft<t.scrollLeft,r=this.offsetLeft-t.offsetLeft+this.clientWidth-o>t.scrollLeft+t.clientWidth,h=f&&!l;(f||l)&&e&&(t.scrollTop=this.offsetTop-t.offsetTop-t.clientHeight/2-i+this.clientHeight/2),(n||r)&&e&&(t.scrollLeft=this.offsetLeft-t.offsetLeft-t.clientWidth/2-o+this.clientWidth/2),(f||l||n||r)&&!e&&this.scrollIntoView(h)}});