File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 31823182
31833183 if ( $ ( '.fancybox-custom-caption.inside-caption' ) . length ) {
31843184 custom_caption_outerHeight = $el . find ( '.fancybox-custom-caption' ) . outerHeight ( ) ;
3185+ } else {
3186+ custom_caption_outerHeight = ( $el . find ( '.fancybox-image' ) . outerHeight ( ) - $el . find ( '.fancybox-image' ) . height ( ) ) / 2 ;
3187+ // Seems like different border width for image requires a little trimming
3188+ if ( custom_caption_outerHeight > 20 && custom_caption_outerHeight < 25 ) {
3189+ custom_caption_outerHeight -= 2 ;
3190+ }
3191+
3192+ if ( custom_caption_outerHeight >= 25 && custom_caption_outerHeight <= 30 ) {
3193+ custom_caption_outerHeight -= 4 ;
3194+ }
3195+
3196+ if ( custom_caption_outerHeight > 30 ) {
3197+ custom_caption_outerHeight -= 6 ;
3198+ }
31853199 }
31863200
31873201 if ( props . height !== undefined ) {
You can’t perform that action at this time.
0 commit comments