You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

6 lines
2.5 KiB

(function(_ds){var window=this;'use strict';var DM=function(){var a=_ds.R.call(this)||this;a.D=null;a.j=null;a.h=null;a.F=!1;a.o=new _ds.Qj;a.m=new _ds.Qj;return a},FM=function(a){a.o.listen(a.D,"click",function(b){return EM(a,b)});a.h&&!a.h.hasAttribute("href")&&a.o.listen(a.h,["click","keypress"],function(b){return EM(a,b)})},EM=function(a,b){if("keypress"!=b.type||13==b.keyCode){a.C=!a.C;for(var c=b.target;c&&c!=a;){if(_ds.js(c,"devsite-nav-title-no-path")&&("click"==b.type||"touchend"==b.type)){c.blur();break}c=c.parentNode}}},
HM=function(a){if(a.j){var b=_ds.nk(a.j);GM(a,b.height,0);a.h&&a.h.setAttribute("aria-expanded","false")}},GM=function(a,b,c){_ds.Wj(a.m);window.requestAnimationFrame(function(){IM(a,b+"px");a.setAttribute("animating","");window.requestAnimationFrame(function(){IM(a,c+"px");_ds.Uj(a.m,a.j,_ds.ex,function(){a.removeAttribute("animating");IM(a);a.dispatchEvent(new CustomEvent("devsite-expandable-nav-transition-end",{bubbles:!0}))})})})},IM=function(a,b){_ds.Zj(a.j,"height",void 0===b?"":b)};
_ds.t(DM,_ds.R);DM.prototype.attributeChangedCallback=function(a){var b=this;"collapsed"==a&&(this.C?HM(this):window.requestAnimationFrame(function(){if(b.j){IM(b);var c=_ds.nk(b.j);IM(b,0);GM(b,0,c.height);b.h&&b.h.setAttribute("aria-expanded","true")}}))};
DM.prototype.connectedCallback=function(){this.D=this.getElementsByClassName("devsite-nav-toggle")[0];this.j=this.getElementsByTagName("ul")[0];this.h=this.getElementsByClassName("devsite-nav-title")[0];this.D&&this.j&&FM(this);this.h&&this.h.setAttribute("aria-expanded",!this.hasAttribute("collapsed"));this.setAttribute("connected","");this.setAttribute("animatable","")};
DM.prototype.disconnectedCallback=function(){_ds.Wj(this.o);_ds.Wj(this.m);this.j&&(IM(this),this.removeAttribute("connected"));this.removeAttribute("animatable");this.h&&this.h.removeAttribute("aria-expanded")};_ds.fa.Object.defineProperties(DM.prototype,{C:{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute("collapsed")},set:function(a){a?this.setAttribute("collapsed",""):this.removeAttribute("collapsed")}}});
_ds.fa.Object.defineProperties(DM,{observedAttributes:{configurable:!0,enumerable:!0,get:function(){return["collapsed"]}}});DM.prototype.disconnectedCallback=DM.prototype.disconnectedCallback;DM.prototype.connectedCallback=DM.prototype.connectedCallback;DM.prototype.attributeChangedCallback=DM.prototype.attributeChangedCallback;try{window.customElements.define("devsite-expandable-nav",DM)}catch(a){console.warn("devsite.app.customElement.DevsiteExpandableNav",a)};})(_ds_www);