Commit 79a529c6 authored by Hixie's avatar Hixie

Specs: custom element constructor argument shouldn't clash with the...

Specs: custom element constructor argument shouldn't clash with the module-global 'module' identifier

Review URL: https://codereview.chromium.org/829133003
parent f8cce948
......@@ -3,8 +3,8 @@ SKY MODULE - button widgets for calculator
<script>
class AbstractButton extends Element {
constructor (module) {
super(module);
constructor (hostModule) {
super(hostModule);
let selector = new SelectorQuery('.dynamic');
this.addEventListener('pointer-down', (event) => {
selector.findAll(this.shadowRoot).every((element) => element.setAttribute('clicked'));
......@@ -59,8 +59,8 @@ SKY MODULE - button widgets for calculator
class extends AbstractButton {
static get tagName() { return 'graybutton'; }
static get shadow() { return true; }
constructor (module) {
super(module);
constructor (hostModule) {
super(hostModule);
this.shadowRoot.append(module.document.findId('threed-button-shadow-tree').cloneNode(true));
}
}
......@@ -69,8 +69,8 @@ SKY MODULE - button widgets for calculator
class extends AbstractButton {
static get tagName() { return 'flatbutton'; }
static get shadow() { return true; }
constructor (module) {
super(module);
constructor (hostModule) {
super(hostModule);
this.shadowRoot.append(module.document.findId('flat-shadow-tree').cloneNode(true));
}
}
......
......@@ -22,10 +22,10 @@ SKY MODULE - defines an <element> element
module.exports.Element = sky.registerElement(
class extends Element {
static get tagName() { return 'element'; }
constructor (module) {
super();
constructor (hostModule) {
super(hostModule);
this.state = 'loading';
this.module = module;
this.module = hostModule;
this.definedPrototype = sky.Element;
}
setPrototype(prototype) {
......@@ -44,8 +44,8 @@ SKY MODULE - defines an <element> element
}
let tagName = this.getAttribute('name');
let constructorName = tagName.charAt(0).toUpperCase() + tagName.slice(1) + 'Element';
let constructor = function (module) {
super(module);
let constructor = function (hostModule) {
super(hostModule);
if (this.init)
this.init();
if (style)
......
......@@ -13,8 +13,8 @@ SKY MODULE - radio button and radio button group
class extends Element {
static get tagName() { return 'radio'; }
static get shadow() { return true; }
constructor (module) {
super(module);
constructor (hostModule) {
super(hostModule);
this.addEventListener('click', (event) => this.checked = true);
this.shadowRoot.append(module.document.findId('radio-shadow').content.cloneNode(true));
}
......@@ -53,8 +53,8 @@ SKY MODULE - radio button and radio button group
class extends Element {
static get tagName() { return 'radiogroup'; }
static get shadow() { return true; }
constructor (module) {
super(module);
constructor (hostModule) {
super(hostModule);
this.shadowRoot.append(module.document.findId('radiogroup-shadow').content.cloneNode(true));
}
get value () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment