Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Commit

Permalink
Reduce getComputedStyle calls (#69)
Browse files Browse the repository at this point in the history
* Reduce getComputedStyle calls

* Add space between if and (
  • Loading branch information
benoitjchevalier authored and valdrinkoshi committed Feb 17, 2017
1 parent cb69845 commit 723716d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion iron-fit-behavior.html
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,11 @@

attached: function() {
// Memoize this to avoid expensive calculations & relayouts.
this._isRTL = window.getComputedStyle(this).direction == 'rtl';
// Make sure we do it only once
if (typeof this._isRTL === 'undefined') {
this._isRTL = window.getComputedStyle(this).direction == 'rtl';
}

this.positionTarget = this.positionTarget || this._defaultPositionTarget;
if (this.autoFitOnAttach) {
if (window.getComputedStyle(this).display === 'none') {
Expand Down

0 comments on commit 723716d

Please sign in to comment.