From d3a95c2d9e90ae9777597f6f34957e8ca4fe92ce Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sat, 16 Apr 2016 16:04:09 +0200 Subject: [PATCH] Perf optimize equalizeFieldHeights --- gridforms/gridforms.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gridforms/gridforms.js b/gridforms/gridforms.js index 7a02e81..6596fe1 100644 --- a/gridforms/gridforms.js +++ b/gridforms/gridforms.js @@ -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);