Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
Fix padding calculation bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpschaaf committed Jan 30, 2015
1 parent 1ce0b62 commit 46c43ec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,7 @@
if (getComputedStyle(this._target).position == 'static') {
this._target.style.position = 'relative';
}
this._target.style.boxSizing = this._target.style.mozBoxSizing = 'border-box';
this.style.overflowY = (target == this) ? 'auto' : null;
},

Expand Down Expand Up @@ -615,9 +616,9 @@
if (!this.width) {
throw 'Grid requires the `width` property to be set';
}
this._rowFactor = Math.floor(this._target.offsetWidth / this.width) || 1;
var cs = getComputedStyle(this._target);
var padding = parseInt(cs.paddingLeft || 0) + parseInt(cs.paddingRight || 0);
this._rowFactor = Math.floor((this._target.offsetWidth - padding) / this.width) || 1;
this._rowMargin = (this._target.offsetWidth - (this._rowFactor * this.width) - padding) / 2;
} else {
this._rowFactor = 1;
Expand Down

0 comments on commit 46c43ec

Please sign in to comment.