Fix empty ad location fieldset being displayed
authorMatthias Schmidt <gravatronics@live.com>
Sat, 21 Mar 2015 12:23:24 +0000 (13:23 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 21 Mar 2015 12:23:24 +0000 (13:23 +0100)
… if Burnign Board is not installed

wcfsetup/install/files/acp/js/WCF.ACP.js

index fb479d1c4963ee539caef3f91cbbf8914a3f527a..a1224ef2405525af2e595de4ad8cfd36a59fae53 100644 (file)
@@ -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));