From 3db3cf952a6f5ae8a6a3b72ded8a9073a8515157 Mon Sep 17 00:00:00 2001 From: Toutouwai Date: Sat, 5 Sep 2015 21:32:33 +1200 Subject: [PATCH] Match column heights when inputfield heights change Columns get out of alignment when the height of the inputfields within the columns change. Any action that affects column height should fire the InputfieldColumnWidths() function. CKEditor fields also need: CKEDITOR.on("instanceReady", function(){ InputfieldColumnWidths(); }); ...because the inputfield height can change after CKEditor loads, but I'm not sure of the best place to add this. --- wire/modules/Inputfield/InputfieldFile/InputfieldFile.js | 4 ++-- wire/modules/Inputfield/InputfieldImage/InputfieldImage.js | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wire/modules/Inputfield/InputfieldFile/InputfieldFile.js b/wire/modules/Inputfield/InputfieldFile/InputfieldFile.js index 078ba133..68e38d3a 100755 --- a/wire/modules/Inputfield/InputfieldFile/InputfieldFile.js +++ b/wire/modules/Inputfield/InputfieldFile/InputfieldFile.js @@ -23,11 +23,11 @@ $(document).ready(function() { if($t.is(":checked")) { // not an error, but we want to highlight it in the same manner $t.parents(".InputfieldFileInfo").addClass("ui-state-error") - .siblings(".InputfieldFileData").slideUp("fast"); + .siblings(".InputfieldFileData").slideUp("fast", InputfieldColumnWidths); } else { $t.parents(".InputfieldFileInfo").removeClass("ui-state-error") - .siblings(".InputfieldFileData").slideDown("fast"); + .siblings(".InputfieldFileData").slideDown("fast", InputfieldColumnWidths); } } diff --git a/wire/modules/Inputfield/InputfieldImage/InputfieldImage.js b/wire/modules/Inputfield/InputfieldImage/InputfieldImage.js index 326ef733..cc271c35 100644 --- a/wire/modules/Inputfield/InputfieldImage/InputfieldImage.js +++ b/wire/modules/Inputfield/InputfieldImage/InputfieldImage.js @@ -98,6 +98,7 @@ $(document).ready(function() { unsetGridMode($parent); setGridMode($parent); } + InputfieldColumnWidths(); }); });