Skip to content
Snippets Groups Projects
Commit af33be73 authored by David Witter's avatar David Witter
Browse files

scope the document get

parent b957c149
No related branches found
No related tags found
No related merge requests found
......@@ -142,21 +142,20 @@
</template>
<script>
// Get the script document
const myuwProfileDoc = (document._currentScript || document.currentScript).ownerDocument;
class MyUWProfile extends HTMLElement {
constructor() {
super();
// Get the script document
MyUWProfile.document = (document._currentScript || document.currentScript).ownerDocument;
this['open-right'] = false;
// Create a shadowroot for this element
this.attachShadow({mode: 'open'});
// Get the template and extract the HTML content
const template = myuwProfileDoc.getElementById('myuw-profile-template');
const template = MyUWProfile.document.getElementById('myuw-profile-template');
// Append the custom HTML to the shadowroot
this.shadowRoot.appendChild(template.content.cloneNode(true));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment