Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions minimalComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ window.MinimalComponent = {
}

// Instantiate template.
this.root = this.createShadowRoot();
if (this.template.getAttribute("noshadowroot") !== null) {
this.root = this;
} else {
this.root = this.createShadowRoot();
}
var clone = document.importNode(this.template.content, true);
this.root.appendChild(clone);

Expand All @@ -61,7 +65,12 @@ window.MinimalComponent = {

// Initialize property values from attributes.
// This invokes an undocumented method internal to Polymer.
this._marshalAttributes();
this._takeAttributesToModel(this);

// Shortcut for this.root.querySelector().
// Mainly useful when not using a shadow root,
// where the this.$ syntax shouldn't really be used
this.qs = this.root.querySelector.bind(this.root);
}

};
Expand Down