Ver código fonte

Intergalactic 2: Correct JavaScript that should exclude Gutenberg-based images from the theme's own wide alignment scripts -- they were excluding all images.

Laurel Fulford 6 anos atrás
pai
commit
ca74401cbe
1 arquivos alterados com 1 adições e 5 exclusões
  1. 1 5
      intergalactic-2/js/intergalactic-2.js

+ 1 - 5
intergalactic-2/js/intergalactic-2.js

@@ -49,12 +49,8 @@
 			new_img.src = img.attr('src');
 			var img_width = new_img.width;
 
-			// Skip images in Gutenberg blocks.
-			if ( $( this ).parents( '[class^="wp-block-"]') ) {
-				return;
-			}
+			if ( img_width >= 1000 && $( this ).parents( '[class^="wp-block-"]').length === 0 ) {
 
-			if ( img_width >= 1000 ) {
 				$( this ).addClass( 'size-big' );
 				$( this ).parents( 'p' ).addClass( 'size-big-wrapper' );