update polymer

This commit is contained in:
Luke Pulverenti 2015-08-08 12:16:34 -04:00
parent d131f21626
commit 891f7bd872
9 changed files with 557 additions and 208 deletions

View file

@ -95,6 +95,38 @@ get: function () {
return (document._currentScript || document.currentScript).ownerDocument;
}
});
Polymer.RenderStatus = {
_ready: false,
_callbacks: [],
whenReady: function (cb) {
if (this._ready) {
cb();
} else {
this._callbacks.push(cb);
}
},
_makeReady: function () {
this._ready = true;
this._callbacks.forEach(function (cb) {
cb();
});
this._callbacks = [];
},
_catchFirstRender: function () {
requestAnimationFrame(function () {
Polymer.RenderStatus._makeReady();
});
}
};
if (window.HTMLImports) {
HTMLImports.whenReady(function () {
Polymer.RenderStatus._catchFirstRender();
});
} else {
Polymer.RenderStatus._catchFirstRender();
}
Polymer.ImportStatus = Polymer.RenderStatus;
Polymer.ImportStatus.whenLoaded = Polymer.ImportStatus.whenReady;
Polymer.Base = {
__isPolymerInstance__: true,
_addFeature: function (feature) {
@ -111,17 +143,22 @@ this._doBehavior('created');
this._initFeatures();
},
attachedCallback: function () {
Polymer.RenderStatus.whenReady(function () {
this.isAttached = true;
this._doBehavior('attached');
}.bind(this));
},
detachedCallback: function () {
this.isAttached = false;
this._doBehavior('detached');
},
attributeChangedCallback: function (name) {
this._setAttributeToProperty(this, name);
this._attributeChangedImpl(name);
this._doBehavior('attributeChanged', arguments);
},
_attributeChangedImpl: function (name) {
this._setAttributeToProperty(this, name);
},
extend: function (prototype, api) {
if (prototype && api) {
Object.getOwnPropertyNames(api).forEach(function (n) {
@ -179,6 +216,7 @@ return Boolean(obj && obj.__isPolymerInstance__);
Polymer.telemetry.instanceCount = 0;
(function () {
var modules = {};
var lcModules = {};
var DomModule = function () {
return document.createElement('dom-module');
};
@ -193,10 +231,11 @@ var id = id || this.id || this.getAttribute('name') || this.getAttribute('is');
if (id) {
this.id = id;
modules[id] = this;
lcModules[id.toLowerCase()] = this;
}
},
import: function (id, selector) {
var m = modules[id];
var m = modules[id] || lcModules[id.toLowerCase()];
if (!m) {
forceDocumentUpgrade();
m = modules[id];
@ -234,6 +273,9 @@ var id = module.id || module.getAttribute('name') || module.getAttribute('is');
this.is = id;
}
}
if (this.is) {
this.is = this.is.toLowerCase();
}
}
});
Polymer.Base._addFeature({
@ -521,7 +563,7 @@ debouncer.stop();
}
}
});
Polymer.version = '1.0.8';
Polymer.version = '1.0.9';
Polymer.Base._addFeature({
_registerFeatures: function () {
this._prepIs();