Ticket #45380: 45380.patch
File 45380.patch, 4.0 KB (added by , 7 years ago) |
---|
-
src/wp-content/themes/twentysixteen/css/blocks.css
25 25 font-style: italic; 26 26 line-height: 1.6153846154; 27 27 padding-top: 0.5384615385em; 28 text-align: left; 28 29 } 29 30 31 .rtl [class^="wp-block-"] figcaption { 32 text-align: right; 33 } 34 30 35 /*-------------------------------------------------------------- 31 36 2.0 Blocks - Common Blocks 32 37 --------------------------------------------------------------*/ … … 37 42 font-size: 5em; 38 43 } 39 44 45 /* Image */ 46 47 @media screen and (min-width: 61.5625em) { 48 body:not(.search-results) article:not(.type-page) .wp-block-image figcaption.below-entry-meta { 49 clear: both; 50 display: block; 51 float: none; 52 margin-right: 0; 53 margin-left: -40%; 54 max-width: 140%; 55 } 56 57 body.rtl:not(.search-results) article:not(.type-page) .wp-block-image figcaption.below-entry-meta { 58 margin-left: 0; 59 margin-right: -40%; 60 } 61 } 62 40 63 /* Gallery */ 41 64 42 65 .wp-block-gallery { -
src/wp-content/themes/twentysixteen/css/editor-blocks.css
262 262 font-style: italic; 263 263 line-height: 1.6153846154; 264 264 padding-top: 0.5384615385em; 265 text-align: left; 265 266 } 266 267 268 .rtl [class^="wp-block-"] figcaption { 269 text-align: right; 270 } 271 267 272 /*-------------------------------------------------------------- 268 273 3.0 Blocks - Common Blocks 269 274 --------------------------------------------------------------*/ -
src/wp-content/themes/twentysixteen/js/functions.js
148 148 entryFooterPos = entryFooter.offset(), 149 149 entryFooterPosBottom = entryFooterPos.top + ( entryFooter.height() + 28 ), 150 150 caption = element.closest( 'figure' ), 151 figcaption = element.next( 'figcaption' ), 151 152 newImg; 152 153 153 154 // Add 'below-entry-meta' to elements below the entry meta. … … 154 155 if ( elementPosTop > entryFooterPosBottom ) { 155 156 156 157 // Check if full-size images and captions are larger than or equal to 840px. 157 if ( 'img.size-full' === param ) {158 if ( 'img.size-full' === param || '.wp-block-image img' === param ) { 158 159 159 160 // Create an image to find native image width of resized images (i.e. max-width: 100%). 160 161 newImg = new Image(); … … 161 162 newImg.src = element.attr( 'src' ); 162 163 163 164 $( newImg ).on( 'load.twentysixteen', function() { 164 if ( newImg.width >= 840 ) { 165 if ( newImg.width >= 840 ) { 166 167 // Check if an image in an image block has a width attribute; if its value is less than 840, return. 168 if ( '.wp-block-image img' === param && element.is( '[width]' ) && element.attr( 'width' ) < 840 ) { 169 return; 170 } 171 165 172 element.addClass( 'below-entry-meta' ); 166 173 167 174 if ( caption.hasClass( 'wp-caption' ) ) { … … 168 175 caption.addClass( 'below-entry-meta' ); 169 176 caption.removeAttr( 'style' ); 170 177 } 178 179 if ( figcaption ) { 180 figcaption.addClass( 'below-entry-meta' ); 181 } 171 182 } 172 183 } ); 173 184 } else { … … 190 201 resizeTimer = setTimeout( function() { 191 202 belowEntryMetaClass( 'img.size-full' ); 192 203 belowEntryMetaClass( 'blockquote.alignleft, blockquote.alignright' ); 204 belowEntryMetaClass( '.wp-block-image img' ); 193 205 }, 300 ); 194 206 onResizeARIA(); 195 207 } ); … … 196 208 197 209 belowEntryMetaClass( 'img.size-full' ); 198 210 belowEntryMetaClass( 'blockquote.alignleft, blockquote.alignright' ); 211 belowEntryMetaClass( '.wp-block-image img' ); 199 212 } ); 200 213 } )( jQuery );