Permalink
Browse files

fix(Component): Fixed argument order on templiteral

  • Loading branch information...
calebdwilliams committed Jul 14, 2018
1 parent 101bce7 commit 5d8b2ed694de944f84fd6a0fbb2316a837e850a3
@@ -78,9 +78,8 @@ class AttributeNode {
console.error(`Method ${handlerName} is not a method of element ${this.context.tagName}`);
} else {
const handler = this.context[handlerName].bind(this.context);
this.node.addEventListener(eventName, this.context[handlerName].bind(this.context));
this.node.addEventListener(eventName, handler);
this.node._boundEvents = handler;

}
}
});
@@ -223,9 +222,13 @@ class Template {

for (let i = 0; i < values.length; i += 1) {
if (values[i] !== this.oldValues[i]) {
window.requestAnimationFrame(() =>
this.partIndicies.get(i).update(values)
);
window.requestAnimationFrame(() => {
try {
this.partIndicies.get(i).update(values);
} catch(e) {
console.log(this.partIndicies.get(i), i, values[i]);
}
});
}
}
}
@@ -330,7 +333,7 @@ class Component extends HTMLElement {
Object.defineProperty(this, 'templiteral', {
get() {
const location = self.shadowRoot ? self.shadowRoot : self;
return templiteral(self, location);
return templiteral(location, self);
},
enumerable: false,
configurable: false
@@ -341,7 +344,7 @@ class Component extends HTMLElement {
get() {
return (...args) => {
window.requestAnimationFrame(() => Reflect.apply(self.templiteral, self, args));
}
};
}
});
}

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -74,9 +74,8 @@ class AttributeNode {
console.error(`Method ${handlerName} is not a method of element ${this.context.tagName}`);
} else {
const handler = this.context[handlerName].bind(this.context);
this.node.addEventListener(eventName, this.context[handlerName].bind(this.context));
this.node.addEventListener(eventName, handler);
this.node._boundEvents = handler;

}
}
});
@@ -219,9 +218,13 @@ class Template {

for (let i = 0; i < values.length; i += 1) {
if (values[i] !== this.oldValues[i]) {
window.requestAnimationFrame(() =>
this.partIndicies.get(i).update(values)
);
window.requestAnimationFrame(() => {
try {
this.partIndicies.get(i).update(values);
} catch(e) {
console.log(this.partIndicies.get(i), i, values[i]);
}
});
}
}
}
@@ -326,7 +329,7 @@ class Component extends HTMLElement {
Object.defineProperty(this, 'templiteral', {
get() {
const location = self.shadowRoot ? self.shadowRoot : self;
return templiteral(self, location);
return templiteral(location, self);
},
enumerable: false,
configurable: false
@@ -337,7 +340,7 @@ class Component extends HTMLElement {
get() {
return (...args) => {
window.requestAnimationFrame(() => Reflect.apply(self.templiteral, self, args));
}
};
}
});
}
Oops, something went wrong.

0 comments on commit 5d8b2ed

Please sign in to comment.