Skip to content

Commit

Permalink
Perf optimize equalizeFieldHeights
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Apr 16, 2016
1 parent 90c62d5 commit d3a95c2
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 d3a95c2

Please sign in to comment.