@@ -395,8 +395,8 @@ if (typeof(PhpDebugBar) == 'undefined') {
395
395
className : "phpdebugbar " + csscls ( 'minimized' ) ,
396
396
397
397
options : {
398
- bodyPaddingBottom : true ,
399
- bodyPaddingBottomHeight : parseInt ( $ ( 'body' ) . css ( 'padding -bottom' ) )
398
+ bodyMarginBottom : true ,
399
+ bodyMarginBottomHeight : parseInt ( $ ( 'body' ) . css ( 'margin -bottom' ) )
400
400
} ,
401
401
402
402
initialize : function ( ) {
@@ -793,7 +793,16 @@ if (typeof(PhpDebugBar) == 'undefined') {
793
793
this . $el . addClass ( csscls ( 'closed' ) ) ;
794
794
this . recomputeBottomOffset ( ) ;
795
795
} ,
796
-
796
+
797
+ /**
798
+ * Checks if the panel is closed
799
+ *
800
+ * @return {Boolean }
801
+ */
802
+ isClosed : function ( ) {
803
+ return this . $el . hasClass ( csscls ( 'closed' ) ) ;
804
+ } ,
805
+
797
806
/**
798
807
* Restore the debug bar
799
808
*
@@ -813,13 +822,17 @@ if (typeof(PhpDebugBar) == 'undefined') {
813
822
} ,
814
823
815
824
/**
816
- * Recomputes the padding -bottom css property of the body so
825
+ * Recomputes the margin -bottom css property of the body so
817
826
* that the debug bar never hides any content
818
827
*/
819
828
recomputeBottomOffset : function ( ) {
820
- if ( this . options . bodyPaddingBottom ) {
821
- var height = parseInt ( this . $el . height ( ) ) + this . options . bodyPaddingBottomHeight ;
822
- $ ( 'body' ) . css ( 'padding-bottom' , height ) ;
829
+ if ( this . options . bodyMarginBottom ) {
830
+ if ( this . isMinimized ( ) || this . isClosed ( ) ) {
831
+ return $ ( 'body' ) . css ( 'margin-bottom' , this . options . bodyMarginBottomHeight || '' ) ;
832
+ }
833
+
834
+ var offset = parseInt ( this . $el . height ( ) ) + this . options . bodyMarginBottomHeight ;
835
+ $ ( 'body' ) . css ( 'margin-bottom' , offset ) ;
823
836
}
824
837
} ,
825
838
0 commit comments