Skip to content

Commit

Permalink
Improve efficiency of attribute configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Orvell committed Oct 28, 2015
1 parent 25aab8b commit f7d86e9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
4 changes: 2 additions & 2 deletions polymer.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@
this._setupDebouncers();
// concretize effects on instance
this._marshalInstanceEffects();
// install host attributes
this._marshalHostAttributes();
// acquire instance behaviors
this._marshalBehaviors();
// install host attributes
this._marshalHostAttributes();
// acquire initial instance attribute values
this._marshalAttributes();
// top-down initial distribution, configuration, & ready callback
Expand Down
18 changes: 13 additions & 5 deletions src/micro/attributes.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,13 @@
// since shimming classes would make it work
// inconsisently under native SD
if (!this.hasAttribute(n) && (n !== 'class')) {
this.serializeValueToAttribute(attr$[n], n, this);
var v = attr$[n];
this.serializeValueToAttribute(v, n, this);
// if necessary, add this value to configuration...
if (!this._clientsReady && this._propertyInfo[n] &&
(this._config[n] === undefined)) {
this._config[n] = v;
}
}
}
},
Expand All @@ -91,10 +97,12 @@
},

_takeAttributesToModel: function(model) {
for (var i in this._propertyInfo) {
var info = this._propertyInfo[i];
if (this.hasAttribute(info.attribute)) {
this._setAttributeToProperty(model, info.attribute, i, info);
if (this.hasAttributes()) {
for (var i in this._propertyInfo) {
var info = this._propertyInfo[i];
if (this.hasAttribute(info.attribute)) {
this._setAttributeToProperty(model, info.attribute, i, info);
}
}
}
},
Expand Down

0 comments on commit f7d86e9

Please sign in to comment.