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.
 
 
 
 
 
 

3 lines
2.0 KiB

(function(_ds){var window=this;'use strict';var zO=function(a){return(0,_ds.V)('<button class="devsite-heading-link button-flat material-icons" data-title="'+_ds.X(a.label)+'"></button>')},AO=function(){var a=_ds.Lt.call(this)||this;a.h=null;a.m=new _ds.Qj;a.j=_ds.ir(zO,{label:"Copy link to this section"});a.o=null;return a},DO=function(a){a.m.listen(document.body,BO,function(b){return void CO(a,b)});a.m.listen(a.j,"click",function(b){b.preventDefault();b.stopPropagation();var c=(b=_ds.Ah(a.h,"devsite-expandable",void 0,2))?b.id:
a.h.id;c&&(b=_ds.zi(),b.hash=c,c=document.createElement("div"),c.innerText=b.href,_ds.zu(a,[c]),_ds.ah(c))})},CO=function(a,b){b=b.target;b!==a.o&&(a.o=b,b.matches&&b.matches("h1.add-link[id],h2:not(.no-link)[id],h3:not(.no-link)[id],h4:not(.no-link)[id],h5:not(.no-link)[id],h6:not(.no-link)[id]")||(b=_ds.zh(b,function(c){return c instanceof Element?c.matches("h1.add-link[id],h2:not(.no-link)[id],h3:not(.no-link)[id],h4:not(.no-link)[id],h5:not(.no-link)[id],h6:not(.no-link)[id]"):!1},!1,3)),b?(b.classList.contains("add-link")||
!("full"===document.body.getAttribute("layout")||_ds.Ah(b,"devsite-dialog",void 0,3)||_ds.Ah(b,"devsite-selector",void 0,6)||_ds.Ah(b,"table",void 0,4)))&&EO(a,b):FO(a))},EO=function(a,b){var c,d;_ds.E(function(e){a.h!==b&&(a.h=b,c=a.h.dataset.text||a.h.textContent)&&(d=a.j,d.dataset.title="Copy link to this section: "+c,a.h.appendChild(a.j));_ds.v(e)})},FO=function(a){a.h&&(a.j.remove(),a.h=null)};var BO="onpointermove"in window?"pointermove":"mousemove";_ds.t(AO,_ds.Lt);AO.prototype.connectedCallback=function(){_ds.Lt.prototype.connectedCallback.call(this);DO(this)};AO.prototype.disconnectedCallback=function(){_ds.Lt.prototype.disconnectedCallback.call(this);_ds.Wj(this.m)};AO.prototype.disconnectedCallback=AO.prototype.disconnectedCallback;AO.prototype.connectedCallback=AO.prototype.connectedCallback;try{window.customElements.define("devsite-heading-link",AO)}catch(a){console.warn("devsite.app.customElement.DevsiteHeadingLink",a)};})(_ds_www);