update components
This commit is contained in:
parent
4f69bbfb13
commit
36d7dc70f3
7 changed files with 98 additions and 51 deletions
|
@ -26,30 +26,22 @@ addEventListener('DOMContentLoaded', resolve);
|
|||
}());
|
||||
window.Polymer = {
|
||||
Settings: function () {
|
||||
var user = window.Polymer || {};
|
||||
var settings = window.Polymer || {};
|
||||
var parts = location.search.slice(1).split('&');
|
||||
for (var i = 0, o; i < parts.length && (o = parts[i]); i++) {
|
||||
o = o.split('=');
|
||||
o[0] && (user[o[0]] = o[1] || true);
|
||||
o[0] && (settings[o[0]] = o[1] || true);
|
||||
}
|
||||
var wantShadow = user.dom === 'shadow';
|
||||
var hasShadow = Boolean(Element.prototype.createShadowRoot);
|
||||
var nativeShadow = hasShadow && !window.ShadowDOMPolyfill;
|
||||
var useShadow = wantShadow && hasShadow;
|
||||
var hasNativeImports = Boolean('import' in document.createElement('link'));
|
||||
var useNativeImports = hasNativeImports;
|
||||
var useNativeCustomElements = !window.CustomElements || window.CustomElements.useNative;
|
||||
var usePolyfillProto = !useNativeCustomElements && !Object.__proto__;
|
||||
return {
|
||||
wantShadow: wantShadow,
|
||||
hasShadow: hasShadow,
|
||||
nativeShadow: nativeShadow,
|
||||
useShadow: useShadow,
|
||||
useNativeShadow: useShadow && nativeShadow,
|
||||
useNativeImports: useNativeImports,
|
||||
useNativeCustomElements: useNativeCustomElements,
|
||||
usePolyfillProto: usePolyfillProto
|
||||
};
|
||||
settings.wantShadow = settings.dom === 'shadow';
|
||||
settings.hasShadow = Boolean(Element.prototype.createShadowRoot);
|
||||
settings.nativeShadow = settings.hasShadow && !window.ShadowDOMPolyfill;
|
||||
settings.useShadow = settings.wantShadow && settings.hasShadow;
|
||||
settings.hasNativeImports = Boolean('import' in document.createElement('link'));
|
||||
settings.useNativeImports = settings.hasNativeImports;
|
||||
settings.useNativeCustomElements = !window.CustomElements || window.CustomElements.useNative;
|
||||
settings.useNativeShadow = settings.useShadow && settings.nativeShadow;
|
||||
settings.usePolyfillProto = !settings.useNativeCustomElements && !Object.__proto__;
|
||||
return settings;
|
||||
}()
|
||||
};
|
||||
(function () {
|
||||
|
@ -176,6 +168,9 @@ Polymer.RenderStatus._catchFirstRender();
|
|||
}
|
||||
Polymer.ImportStatus = Polymer.RenderStatus;
|
||||
Polymer.ImportStatus.whenLoaded = Polymer.ImportStatus.whenReady;
|
||||
(function () {
|
||||
'use strict';
|
||||
var settings = Polymer.Settings;
|
||||
Polymer.Base = {
|
||||
__isPolymerInstance__: true,
|
||||
_addFeature: function (feature) {
|
||||
|
@ -185,14 +180,31 @@ registerCallback: function () {
|
|||
this._desugarBehaviors();
|
||||
this._doBehavior('beforeRegister');
|
||||
this._registerFeatures();
|
||||
this._doBehavior('registered');
|
||||
if (!settings.lazyRegister) {
|
||||
this.ensureRegisterFinished();
|
||||
}
|
||||
},
|
||||
createdCallback: function () {
|
||||
if (!this.__hasRegisterFinished) {
|
||||
this._ensureRegisterFinished(this.__proto__);
|
||||
}
|
||||
Polymer.telemetry.instanceCount++;
|
||||
this.root = this;
|
||||
this._doBehavior('created');
|
||||
this._initFeatures();
|
||||
},
|
||||
ensureRegisterFinished: function () {
|
||||
this._ensureRegisterFinished(this);
|
||||
},
|
||||
_ensureRegisterFinished: function (proto) {
|
||||
if (proto.__hasRegisterFinished !== proto.is) {
|
||||
proto.__hasRegisterFinished = proto.is;
|
||||
if (proto._finishRegisterFeatures) {
|
||||
proto._finishRegisterFeatures();
|
||||
}
|
||||
proto._doBehavior('registered');
|
||||
}
|
||||
},
|
||||
attachedCallback: function () {
|
||||
var self = this;
|
||||
Polymer.RenderStatus.whenReady(function () {
|
||||
|
@ -271,6 +283,7 @@ Polymer.isInstance = function (obj) {
|
|||
return Boolean(obj && obj.__isPolymerInstance__);
|
||||
};
|
||||
Polymer.telemetry.instanceCount = 0;
|
||||
}());
|
||||
(function () {
|
||||
var modules = {};
|
||||
var lcModules = {};
|
||||
|
@ -652,7 +665,7 @@ return value != null ? value : undefined;
|
|||
}
|
||||
}
|
||||
});
|
||||
Polymer.version = '1.3.1';
|
||||
Polymer.version = '1.4.0';
|
||||
Polymer.Base._addFeature({
|
||||
_registerFeatures: function () {
|
||||
this._prepIs();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue