| Index: sky/framework/sky-element/sky-element.sky
|
| diff --git a/sky/framework/sky-element/sky-element.sky b/sky/framework/sky-element/sky-element.sky
|
| index 35578725d86c927f38e68d4fb4c08d1c2be3828f..c064255a71039288b1587cab39f90f385b50b54a 100644
|
| --- a/sky/framework/sky-element/sky-element.sky
|
| +++ b/sky/framework/sky-element/sky-element.sky
|
| @@ -4,60 +4,51 @@
|
| // found in the LICENSE file.
|
| -->
|
| <link rel="import" href="TemplateBinding.sky" />
|
| -
|
| <script>
|
| -(function(global) {
|
| - 'use strict';
|
| -
|
| - var Base = {
|
| -
|
| - __proto__: HTMLElement.prototype,
|
| -
|
| - register: function() {
|
| - // |this| is prototype
|
| - var template = document.currentScript.previousElementSibling;
|
| - if (template && template.localName == 'template') {
|
| - this.template_ = template;
|
| - }
|
| - },
|
| -
|
| - createdCallback: function() {
|
| - },
|
| -
|
| - attachedCallback: function() {
|
| - var shadow = this.createShadowRoot();
|
| - shadow.appendChild(this.template_.createInstance(this));
|
| - this.attached();
|
| - },
|
| -
|
| - attached: function() {
|
| - // override
|
| - },
|
| -
|
| - dettachedCallback: function() {
|
| - this.dettached();
|
| - },
|
| -
|
| - dettached: function() {
|
| - // override
|
| - },
|
| -
|
| - attributeChangedCallback: function(attrName, oldValue, newValue) {
|
| - // reserved for canonical behavior
|
| - this.attributeChanged(attrName, oldValue, newValue);
|
| - },
|
| -
|
| - attributeChanged: function(attrName, oldValue, newValue) {
|
| - // override
|
| - }
|
| - };
|
| -
|
| - function SkyElement(prototype) {
|
| - prototype.__proto__ = Base;
|
| - document.registerElement(prototype.name, { prototype: prototype });
|
| - prototype.register();
|
| - };
|
| -
|
| - module.exports = SkyElement;
|
| -})(this);
|
| +var Base = Object.create(HTMLElement.prototype, {
|
| + register: function() {
|
| + // |this| is prototype
|
| + var template = document.currentScript.previousElementSibling;
|
| + if (template && template.localName == 'template')
|
| + this.template_ = template;
|
| + },
|
| +
|
| + createdCallback: function() {
|
| + },
|
| +
|
| + attachedCallback: function() {
|
| + var shadow = this.createShadowRoot();
|
| + shadow.appendChild(this.template_.createInstance(this));
|
| + this.attached();
|
| + },
|
| +
|
| + attached: function() {
|
| + // override
|
| + },
|
| +
|
| + dettachedCallback: function() {
|
| + this.dettached();
|
| + },
|
| +
|
| + dettached: function() {
|
| + // override
|
| + },
|
| +
|
| + attributeChangedCallback: function(attrName, oldValue, newValue) {
|
| + // reserved for canonical behavior
|
| + this.attributeChanged(attrName, oldValue, newValue);
|
| + },
|
| +
|
| + attributeChanged: function(attrName, oldValue, newValue) {
|
| + // override
|
| + },
|
| +};
|
| +
|
| +function SkyElement(prototype) {
|
| + prototype.__proto__ = Base;
|
| + document.registerElement(prototype.name, { prototype: prototype });
|
| + prototype.register();
|
| +};
|
| +
|
| +module.exports = SkyElement;
|
| </script>
|
|
|