Skip to content

Commit

Permalink
remove unneeded flag.
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Orvell committed Jun 22, 2016
1 parent 4852f6c commit b5b8a2a
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/lib/custom-style.html
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,12 @@
if (this.__appliedElement !== this) {
this.__appliedElement.__cssBuild = this.__cssBuild;
}
// needed becuase elements in imports do not get 'attached'
this._tryApply();
},

// needed to support dynamic custom styles created outside document
// and then added to it.
attached: function() {
this._tryApply();
},
Expand Down Expand Up @@ -173,7 +176,7 @@

// polyfill this style with root scoping and
// apply custom properties!
_apply: function(deferProperties) {
_apply: function(initialApply) {
// used applied element from HTMLImports polyfill or this
var e = this.__appliedElement;
if (this.include) {
Expand Down Expand Up @@ -236,19 +239,15 @@
var fn = function fn() {
self._flushCustomProperties();
}
if (deferProperties) {
if (!this.__scheduledPropertiesFlush) {
this.__scheduledPropertiesFlush = true;
Polymer.RenderStatus.whenReady(fn);
}
if (initialApply) {
Polymer.RenderStatus.whenReady(fn);
} else {
fn();
}
}
},

_flushCustomProperties: function() {
this.__scheduledPropertiesFlush = false;
// if this style has not yet applied at all and it was loaded asynchronously
// (detected by Polymer being ready when this element tried to apply), then
// do a full updateStyles to ensure that
Expand Down

0 comments on commit b5b8a2a

Please sign in to comment.