From: Matthias Schmidt Date: Sat, 21 Mar 2015 12:23:24 +0000 (+0100) Subject: Fix empty ad location fieldset being displayed X-Git-Tag: 2.1.2~22 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fff8c61ad1ff3bf8ac7bf807ee9171cf062f05ef;p=GitHub%2FWoltLab%2FWCF.git Fix empty ad location fieldset being displayed … if Burnign Board is not installed --- diff --git a/wcfsetup/install/files/acp/js/WCF.ACP.js b/wcfsetup/install/files/acp/js/WCF.ACP.js index fb479d1c49..a1224ef240 100644 --- a/wcfsetup/install/files/acp/js/WCF.ACP.js +++ b/wcfsetup/install/files/acp/js/WCF.ACP.js @@ -2696,11 +2696,24 @@ WCF.ACP.Ad.LocationHandler = Class.extend({ this._pageConditions = $('#pageConditions'); this._pageControllers = $('#pageControllers'); + var $dl = this._pageControllers.parents('dl:eq(0)'); + // hide the page controller element - this._pageControllers.parents('dl:eq(0)').hide(); + $dl.hide(); + + var $fieldset = $dl.parent('fieldset'); + if (!$fieldset.children('dl:visible').length) { + $fieldset.hide(); + } + + var $nextFieldset = $fieldset.next('fieldset'); + if ($nextFieldset) { + $nextFieldset.data('margin-top', $nextFieldset.css('margin-top')); + $nextFieldset.css('margin-top', 0); + } // fix the margin of a potentially next page condition element - this._pageControllers.parents('dl:eq(0)').next('dl').css('margin-top', 0); + $dl.next('dl').css('margin-top', 0); $('#objectTypeID').on('change', $.proxy(this._setPageController, this));