File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 752
752
}
753
753
} ;
754
754
755
+ this . calculateElementHeight = function ( ) {
756
+ return ( this . sizeY * this . gridster . curRowHeight - this . gridster . margins [ 0 ] ) ;
757
+ }
758
+
759
+ this . calculateElementWidth = function ( ) {
760
+ return ( this . sizeX * this . gridster . curColWidth - this . gridster . margins [ 1 ] ) ;
761
+ }
762
+
755
763
/**
756
764
* Sets an elements height
757
765
*/
758
766
this . setElementSizeY = function ( ) {
759
767
if ( this . gridster . isMobile && ! this . gridster . saveGridItemCalculatedHeightInMobile ) {
760
768
this . $element . css ( 'height' , '' ) ;
761
769
} else {
762
- this . $element . css ( 'height' , ( this . sizeY * this . gridster . curRowHeight - this . gridster . margins [ 0 ] ) + 'px' ) ;
770
+ this . $element . css ( 'height' , this . calculateElementHeight ( ) + 'px' ) ;
763
771
}
764
772
} ;
765
773
770
778
if ( this . gridster . isMobile ) {
771
779
this . $element . css ( 'width' , '' ) ;
772
780
} else {
773
- this . $element . css ( 'width' , ( this . sizeX * this . gridster . curColWidth - this . gridster . margins [ 1 ] ) + 'px' ) ;
781
+ this . $element . css ( 'width' , this . calculateElementWidth ( ) + 'px' ) ;
774
782
}
775
783
} ;
776
784
} )
You can’t perform that action at this time.
0 commit comments