Skip to content

Commit

Permalink
Merge pull request #51 from staabm/patch-1
Browse files Browse the repository at this point in the history
Perf optimize equalizeFieldHeights
  • Loading branch information
kumailht committed Apr 18, 2016
2 parents 90c62d5 + d3a95c2 commit 87cf5c6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions gridforms/gridforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ jQuery(function($) {
// Make sure that the fields aren't stacked
if (!this.areFieldsStacked()) {
fieldsRows.filter(":visible").each(function() {
// Get the height of the row (thus the tallest element's height)
var fieldRow = $(this);
var rowHeight = fieldRow.css('height');

// Singleton textarea rows should determine their row height
var rowInputs = fieldRow.children();
var textAreas = rowInputs.children("textarea");
if (rowInputs.length === 1 && textAreas.length === 1) return;
if (rowInputs.length === 1 && rowInputs.children("textarea").length === 1) return;

// Get the height of the row (thus the tallest element's height)
var rowHeight = fieldRow.css('height');

// Set the height for each field in the row...
fieldRow.find(fieldsContainers).css('height', rowHeight);
Expand Down

0 comments on commit 87cf5c6

Please sign in to comment.