ソースを参照

Independent Pub 2: fix outdent for large images (#3055)

Sérgio Gomes 4 年 前
コミット
838be3fcaa

+ 1 - 1
independent-publisher-2/functions.php

@@ -213,7 +213,7 @@ function independent_publisher_2_scripts() {
 	wp_enqueue_script( 'independent-publisher-2-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20170317', true );
 
 	if ( ! is_active_sidebar( 'sidebar-1' ) ) {
-		wp_enqueue_script( 'independent-publisher-2-images', get_template_directory_uri() . '/js/independent-publisher-2.js', array(), '20210111', true );
+		wp_enqueue_script( 'independent-publisher-2-images', get_template_directory_uri() . '/js/independent-publisher-2.js', array(), '20210118', true );
 	}
 
 	// If there's an active Video widget, and it's (hopefully) in the footer widget area

+ 1 - 1
independent-publisher-2/js/independent-publisher-2.js

@@ -85,7 +85,7 @@
 				// Use an IIFE to avoid scoping issues.
 				( function ( img, caption, newImg ) {
 					return function () {
-						var imgWidth = newImg.offsetWidth;
+						var imgWidth = newImg.width;
 
 						if ( imgWidth >= 1100 &&
 								! closest( img, '.tiled-gallery-item-large' ) &&