Add medium_large image to possible backstretch image sources

This commit is contained in:
Robin Cornett
2015-12-10 09:14:49 -05:00
parent ad5c7ebd64
commit 19274bb2e3
2 changed files with 23 additions and 8 deletions
@@ -114,12 +114,20 @@ class Display_Featured_Image_Genesis_Output {
'fade' => 750,
) );
$image_id = Display_Featured_Image_Genesis_Common::set_image_id();
$large = wp_get_attachment_image_src( $image_id, 'large' );
$output = array(
'src' => esc_url( $this->item->backstretch[0] ),
'largesrc' => esc_url( $large[0] ),
'width' => $large[1],
$image_id = Display_Featured_Image_Genesis_Common::set_image_id();
$large = wp_get_attachment_image_src( $image_id, 'large' );
$medium_large = wp_get_attachment_image_src( $image_id, 'medium_large' );
$output = array(
'source' => array(
'backstretch' => esc_url( $this->item->backstretch[0] ),
'large' => esc_url( $large[0] ),
'medium_large' => esc_url( $medium_large[0] ),
),
'width' => array(
'backstretch' => $this->item->backstretch[1],
'large' => $large[1],
'medium_large' => $medium_large[1],
),
'height' => (int) $this->displaysetting['less_header'],
'centeredX' => (int) (bool) $backstretch_vars['centeredX'],
'centeredY' => (int) (bool) $backstretch_vars['centeredY'],
+9 -2
View File
@@ -13,13 +13,20 @@
function _backstretchHandler() {
var source = window.innerWidth <= plugin.params.width ? plugin.params.largesrc : plugin.params.src,
var source = plugin.params.source.backstretch,
$el = $( '.big-leader' );
if (typeof $el === 'undefined') {
if ( typeof $el === 'undefined' ) {
return false;
}
if ( window.innerWidth <= plugin.params.width.large ) {
source = plugin.params.source.large;
}
if ( window.innerWidth <= plugin.params.width.medium_large ) {
source = plugin.params.source.medium_large;
}
$el.css( {
height: ( $(window).height() ) - ( [ plugin.params.height ] ) + 'px'
} );