toolshed-8.x-1.x-dev/js/widgets/Pane.min.js

js/widgets/Pane.min.js
"use strict";(({Toolshed:i})=>{class e extends i.Element{static defaultOptions(){return{classes:[]}}constructor(t={}){super("div",null,document.body),this.opts={...e.defaultOptions(),...t},this.content=new i.Element("div",{class:"pane__content"},this),this.addClass(this.opts.classes.concat("ts-pane","pane")),this.setStyles({display:"none",position:"absolute",zIndex:this.opts.zIndex}),this.append=this.opts.onAddItem?t=>{var e=this.opts.onAddItem(t);this.appendItem(e||t)}:this.appendItem,this.remove=this.opts.onRemoveItem?t=>{var e=this.opts.onRemoveItem(t);this.removeItem(e||t)}:this.removeItem}prependItem(t){return this.content.prependChild(t),this}appendItem(t){return this.content.appendChild(t),this}removeItem(t){return this.content.removeChild(t),this}clear(){return this.content.empty(),this}isVisible(){return"none"!==this.style.display}positionPane(){}open(){return this.isVisible()||(this.style.display="",this.positionPane()),!0}close(){return!(this.style.display="none")}toggle(){return this.isVisible()?this.close():this.open()}destroy(){this.clear(),super.destroy(!0)}}class t extends e{constructor(t,e={}){super(e),this.attachTo=t}positionPane(){var t=this.attachTo.getBoundingClientRect();const e=document.documentElement.scrollLeft||document.body.scrollLeft,s=document.documentElement.scrollTop||document.body.scrollTop;if(this.style.top=t.top>this.el.clientHeight?s-this.el.clientHeight+t.bottom+"px":s+t.top+"px",this.style.left=e+t.right+"px",!this.opts.zIndex&&!this.style.zIndex){let t=this.attachTo,e=10;for(;t;){var n=(t.style||{}).zIndex||window.getComputedStyle(t).getPropertyValue("z-index");(Number.isInteger(n)||/\d+/.test(n))&&(n=(i.isString(n)?parseInt(n,10):n)+10)>e&&(e=n),t=t.parentElement}this.style.zIndex=e}}}i.Pane=e,i.AttachedPane=t})(Drupal);

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc