Site icon DIY Idea

Elote Inspired Pizza

Elote Inspired Pizza

By Becky Sue from Baking the Goods.

Elote, aka Mexican Street Corn, is a crave-able street food that hits on all of the fresh, zesty, spicy, sweet, herby and salty buttons. It’s a beloved combo that always delivers. This Elote Inspired Pizza combines fresh elote ingredients on a bed of chewy pizza crust with a few extra ingredients for the ultimate pizza recipe.

Elote inspired Pizza by Baking The Goods

[feast_advanced_jump_to]

The recipe starts with the spirit of Elote and reimagines the flavors in pizza form. Bringing in a a few additional toppings that compliment the classic flavors. Fresh corn, chili spiced Garlic Crema Sauce, crumbly Cotija cheese, herbs, pickled red onions, sliced jalapeños and lime give this Elote Inspired Pizza its vibrant personality.

Summer corn goes with everything

There is no better time to enjoy corn that at the peak of summer. And luckily, there are a multitude of delicious ways to prepare fresh corn! Simply grill corn on the cob and slather it in butter, salt and pepper for a classic. Bake it into these savory and sweet Heirloom Tomato & Grilled Corn Galettes with Cheddar Crust or mix fresh corn into summery salads. And now, add this new summery favorite to your summer menu and scatter that corn atop this spectacularly seasonal Elote Inspired Pizza. 

Elote is a flavorful summer treat

If you’ve never had Elote, it’s worth doing a little research to see if you can find some in your area. Elote is one of those living your best life foods. It’s equal parts messy and delicious.

First, fresh corn the cob gets a good grilling until it’s got some char going on. Then the corn is smeared and coated in a mayo and crema mix, sprinkled with crumbly Cotija cheese, spritzed with lime and spiced with chile powder. It’s often served on a stick and tastes especially satisfying when handed over straight from a street vendor on a hot summer day.

With this Elote Inspired Pizza recipe, you get all of that goodness but served up in a pizza pie. It’s a tip of the hat to Mexican Street Corn but all spread out and cooked on top of a pizza instead of served on the cob.

A great pizza starts with a solid Pizza Dough recipe

Pizza Dough is always best when homemade, at least in my opinion. And wouldn’t ya know it, I’ve got a couple of pizza dough recipe options for you! My Quick and Easy Pizza Dough recipe comes together in 5 minutes and goes from rise to ready in under 2 hours. This pizza dough recipe is super solid, easy as can be and works like a champ every single time. Plus it tastes great and bakes up beautifully. 

If you are looking for something with a little more age and character, this 72 Hour Pizza Dough recipe is a fabulous option. Don’t let the 72 Hour name scare you, it mixes up quick and the bulk of that time is a slow fermentation process that mostly happens in your fridge. So, if you have the time and want a chewy crust with tons of character, go for the 72 Hour Pizza Dough! Either way, you can’t go wrong.

Divide the dough into 2 large pizzas, 3 medium pizzas or 4-5 personal sized pizzas

Both of these pizza dough recipes can be divided into 2 large pizzas, 3 medium pizzas or 4-5 personal sized pizzas. When I have friends over for pizza nights, I divide the dough into 4 or 5 dough balls so everyone can make their own pizza and top it as they please.

Elote Inspired Pizza Ingredients

A handful of fresh ingredients and some pizza dough is all it takes to make this fresh and flavorful Elote Pizza. It’s a simple mix of complimentary ingredients that vibrate with flavor. Fresh sweet corn is one of summer’s greatest gifts. It doesn’t need a lot of fuss and it only gets better when mingling with some salt and spice.

The Elote Pizza ingredients are bright, fresh and compliment each other deliciously.

This Elote-inspired pizza is a fresh alternative to a red sauce pizza

My deep love and commitment to all things tomatoes has deemed me a red sauce fiend for life. It may be a borderline tomato addiction, to be honest. See also my recipes for my Heirloom Tomato Pimento Cheese Tart, Roasted Tomato Whipped Feta Dip, Cherry Tomato Confit, Heirloom Tomato & Grilled Corn Galettes with Cheddar Crust and Cherry Tomato Cobbler with Cheddar Everything Biscuits to name a few tomato centric recipes!

However, this Elote Inspired Pizza often has me craving a white sauce pizza over a red sauce based pizza. Which is saying a whole lot for this recipe and me! While I think of white and red pizzas as two different pizza camps entirely, this elote pizza situation offers another category altogether! It’s fresh, bright, sweet, spicy, cheesy, earthy, herby and oh so craveable. 

How to make Garlic Crema Pizza Sauce

Elote traditionally gets smeared in a messy mix of crema and mayo. Instead, this Elote Inspired Pizza reaches towards a classic white pizza sauce with a quick homemade Garlic Crema Sauce. For this recipe, I omitted the mayo and added a few flavor enhancers in its place.

Garlic Crema Pizza Sauce ingredients

Make the Garlic Crema Sauce ahead of time so the flavors can meld

That’s it! It all just gets stirred together and you are good to go. I do recommend making the Garlic Crema Sauce at least an hour beforehand, if not longer. The flavor develops more when it has a chance to sit and all of the ingredients can mingle for a bit.

How to bake the Elote Pizza

If you are making your pizza dough from scratch, it makes sense to prepare the Crema Sauce once you’ve prepared your pizza dough. Then it can marinate and meld together while the pizza dough rises. But, if you don’t have time, it’s still great freshly mixed too!

Like all pizza recipes, there are many different baking methods for baking the Elote Inspired Pizza. It comes down to what resources you have available and personal preference. Nowadays there are all kinds of pizza oven options. While just a standard home oven can easily do the trick, cool gadgets like a Baking Steel or an Ooni Pizza Oven will have you cranking out Neaoplotan style pizzas in minutes!

In order to get that chewy, charred and bubbly pizza dough, a rippin’ hot oven is a requirement. Professional pizza bakes up quick in a hot hot oven. Like, upwards of 1000°F hot. While that is extreme, you can still get similar results at home.

Tips for baking pizza in a home oven

While I have made many a pizza in my home oven, now that I have an outdoor Ooni Pizza Oven, this Elote Inspired Pizza, with it’s summery ingredient list, just makes sense to bake and serve al fresco. It takes the mess of pizza making outside and encourages a fun hang with friends while churning out a long line of pizzas from that hot little oven.

Tips for baking pizza in an outdoor pizza oven

Practice makes perfect pizza

No matter what method you use for cooking pizzas, it takes a while to get in the groove. However, once you’ve developed a system and that pizza making muscle memory sets in, you’ll be slinging pies like a pro. Shaping and stretching pizza dough just takes a little getting used to. But there are some simple tips to keep in mind.

Tips for shaping pizza dough

Check out my Quick and Easy Pizza Dough recipe for loads of pizza making and shaping tips. If you have a good understanding going in, you’ll be armed with confidence when making pizzas at home! However, you want the dough to be thin enough that you can almost see through it when you hold it up to the light.

And remember to be patient, don’t get flustered and always have an extra dough round in case things go awry. It may be wonky the first few times, until you get the hang of it. Like the first pancake of the batch, it takes time and practice to find your groove. And, if all goes smoothly, make an extra pizza with the remaining dough round and save it for lunch the next day. Because leftover pizza is always a good plan.

How to top Elote Pizza

Topping the Elote Inspired Pizza is simple. Once your dough is stretched and ready, you’ll simple spread on the Garlic Crema Sauce. Then, add some shredded mozzarella. Top with the fresh corn, layer on pickled onions and sliced jalapeños. Then crumble on some Cotija cheese. Easy, cheesy and ready to hit that heat!

Finish and serve the summery Corn Pizza

Right after the Elote Pizza comes out of the hot oven, drizzle some good quality olive oil over the entire pizza with a little extra focus on the crust edges. This gives the pizza added richness and a sexy glistening sheen. Then sprinkle on the freshly chopped cilantro and green onions for an herby, fresh finish!

If you want to switch up your pizza game, I highly recommend baking an Elote Inspired Pizza right away. It is an experience all it’s own and tastes particularly special outside on a summer night. And as unconventional as it may sound, this pizza pairs pretty perfectly with a side of chips and guac and a salted Margarita chaser! Cheers and enjoy the Elote Pizza experience.

More Pizza recipes from Baking The Goods

  • Cheesy Garlic Bread Pizza
  • Garlic & Fennel Mushroom Pizza
  • Tomato Confit Burrata and Arugula Pizza
  • Fig and Pistachio Pesto Pizza

Print

Recipe

Elote Inspired Pizza


5 Stars 4 Stars 3 Stars 2 Stars 1 Star

No reviews


  • Author:
    Becky Sue of Baking The Goods


  • Total Time:
    0 hours


  • Yield:
    2 large, 3 medium or 4 personal sized pizzas


Print Recipe

Save Recipe

Recipe Saved

Description

This Elote Inspired Pizza hits on all of the fresh, zesty, spicy, sweet, herby and salty Mexican Street Corn buttons. Combining fresh Elote ingredients on a bed of chewy pizza crust with a few extra ingredients for the ultimate pizza recipe.


Ingredients

Pizza Dough

1 batch Quick & Easy Pizza Dough, makes 2 large, 3 medium or 4 personal sized pizzas. Alternatively, use store bought pizza dough or your favorite recipe.

Garlic Crema Sauce

1 cup Mexican crema or sour cream

2 cloves garlic, minced

½ small lime, zested and juiced (save other half for spritzing on the finished pizza)

¾ teaspoon ancho, chipotle, guajillo or other chili powder

¾ teaspoon fine sea salt

Elote Pizza Toppings

2 ears of fresh corn

2 cups low moisture mozzarella, shredded

1 cup cotija cheese, crumbled

½ cup red onions, pickled or thinly sliced

1 jalapeño, thinly sliced

½ cup cilantro, roughly chopped

1/42 cup green onions, thinly sliced

olive oil, to taste

fresh lime wedges, reserved from sauce

all purpose or 00 flour, for shaping

semolina flour, for baking



Instructions

PREP

If your prepared pizza dough is chilling, remove it from the refrigerator and allow to sit at room temperature for 30 minutes to 1 hour. In the meantime, preheat your oven or pizza oven in order to get to rippin’ hot pizza temps. 

For a home oven: Arrange the rack in the middle of your oven and if using Baking Steel or Pizza Stone, place it on the rack before turning on the oven. Preheat the oven to 550°F or as high as your oven will go.  Allow the oven to heat up for at least 30-45 minutes. 

For outdoor pizza oven: Get your outdoor oven set up and ready, depending on the type and settings of your oven. I like to bake my pizzas in my Ooni somewhere in the 700 – 800°F range. When using the gas insert, it takes about 20 minutes to heat up.

GARLIC CREMA SAUCE

Combine all ingredients in a mixing bowl and stir together until blended. Cover and place in the refrigerator until ready to use. The sauce will develop more flavor the longer it melds together in the fridge. 

SHAPE & TOP ELOTE PIZZA

Lightly dust your hands and a pizza peel with flour and place the pizza dough ball on the peel.

Press the dough out on the pizza peel into a small, flat disc. Starting in the center and evenly pushing out towards the edges until it starts to spread into a larger, round disc.

Stretch the dough by holding one edge of the pizza dough with both of your hands and allow the weight and gravity to lightly stretch the dough towards the table as you carefully rotate the dough between your hands in a wheel turning motion. Keep the dough moving continuously as it stretches and pulls, being careful to not let it get so thin it tears. However, you want the dough to be thin enough that you can almost see through it when you hold it up to the light.

Generously sprinkle semolina flour over onto the pizza peel to keep the dough from sticking. Place the dough round on the peel and test the stickiness by giving it a good jiggle. The dough should slide around with ease. If it’s sticking, add more semolina between the peel and the dough.

Top the pizza, first spoon some Garlic Crema Sauce onto the center of the stretched dough round. Use the spoon to spread the sauce evenly on the surface of the dough, leaving a rim around the edge. Next, sprinkle on the mozzarella, corn, pickled red onions and jalapeños. Crumble on the Cotija cheese. Don’t over top your pizza, it will weigh down your pizza and make it difficult to slide into the oven.

BAKE THE ELOTE PIZZA

For a home oven:  If baking on a Baking Steel or Stone, use a pizza peel or the underside of a baking sheet to slide your pizza onto the baking steel or stone. Alternatively, shape and bake the pizza right on the underside of the baking sheet. Bake for 5-ish minutes and rotate the pizza. Then bake for another 3-5 minutes. It’s ready when the cheese is melty and browning and the crust is bubbly and golden. Just keep an eye on it, times may vary depending on your oven. 

For outdoor pizza oven: Check the temperature of your preheated outdoor pizza oven, I like to bake my pizzas in my Ooni somewhere in the 700 – 800°F range. Give your pizza another jiggle on that peel to make sure it’ll slide still. Launch the pizza into the oven by angling the peel towards the back of your oven. Quickly shimmy the peel away from the pizza as you slide it into the oven. Move quickly with confidence!

This pizza should cook in 60-90 seconds! After about 1 minute, carefully rotate the pizza with a metal pizza peel or a pair of long tongs to ensure even cooking, rotating about every 15 seconds until the cheese is melty and browning and the crust is bubbly and slightly charred.

FINISH & SERVE

Use a peel to transfer the pizza to a plate. Drizzle olive oil over the crust edge and  a bit on top. Then sprinkle with cilantro and green onions and spritz with a hit of lime. Serve immediately while hot and bubbly for the ultimate cheese pull experience!

Notes

This recipe makes 2 large, 3 medium or 4-5 personal sized pizzas. 

Use my Quick & Easy Pizza Dough recipe for a simple and solid pizza crust base.

  • Prep Time: 15
  • Preheating Time: 30 minutes +
  • Cook Time: 10
  • Category: pizza

window.trCommon={“minRating”:6,”ajaxurl”:”https:\/\/bakingthegoods.com\/wp-admin\/admin-ajax.php”,”ratingNonce”:””,”postId”:35072};
window.TastyRecipes = window.TastyRecipes || {};

window.TastyRecipes.smoothScroll = {
init() {
document.addEventListener( ‘click’, ( e ) => {
let anchor = e.target;
if ( anchor.tagName !== ‘A’ ) {
anchor = anchor.closest( ‘a.tasty-recipes-scrollto’ );
}

if ( ! anchor || ! anchor.classList.contains( ‘tasty-recipes-scrollto’ ) ) {
return;
}

const elementHref = anchor.getAttribute( ‘href’ );
if ( ! elementHref ) {
return;
}

e.preventDefault();
this.goToSelector( elementHref );
});
},
goToSelector( selector ) {
const element = document.querySelector( selector );
if ( ! element ) {
return;
}
element.scrollIntoView( { behavior: ‘smooth’ } );
}
};

document.addEventListener(
‘DOMContentLoaded’,
() => window.TastyRecipes.smoothScroll.init()
);

(function(){
document.querySelectorAll(‘[data-tr-ingredient-checkbox]’).forEach(function(el) {
var input = el.querySelector(‘.tr-ingredient-checkbox-container input[type=”checkbox”]’);
if ( ! input ) {
return;
}
if (input.checked) {
el.dataset.trIngredientCheckbox = ‘checked’;
}
el.addEventListener(‘click’, function(event) {
if ( ‘A’ === event.target.nodeName
|| ‘INPUT’ === event.target.nodeName
|| ‘LABEL’ === event.target.nodeName ) {
return;
}
input.click();
});
input.addEventListener(‘change’, function() {
el.dataset.trIngredientCheckbox = input.checked ? ‘checked’ : ”;
});
});
}());

window.TastyRecipes = window.TastyRecipes || {};
window.TastyRecipes.cookMode = {
wakeLockApi: false,
wakeLock: false,
cookModeSelector: ‘.tasty-recipes-cook-mode’,
init() {
if (“wakeLock” in navigator && “request” in navigator.wakeLock) {
this.wakeLockApi = navigator.wakeLock;
}

const cookModes = document.querySelectorAll(this.cookModeSelector);

if (cookModes.length > 0) {
for (const cookMode of cookModes) {
if (this.wakeLockApi) {
cookMode.querySelector(‘input[type=”checkbox”]’).addEventListener(“change”, event => {
this.checkboxChange(event.target);
}, false);
} else {
cookMode.style.display = “none”;
}
}
}
},
checkboxChange(checkbox) {
if (checkbox.checked) {
this.lock();
} else {
this.unlock();
}
},
setCheckboxesState(state) {
const checkboxes = document.querySelectorAll(this.cookModeSelector + ‘ input[type=”checkbox”]’);
for (const checkbox of checkboxes) {
checkbox.checked = state;
}
},
async lock() {
try {
this.wakeLock = await this.wakeLockApi.request(“screen”);
this.wakeLock.addEventListener(“release”, () => {
this.wakeLock = false;
this.setCheckboxesState(false);
});
this.setCheckboxesState(true);
} catch (error) {
this.setCheckboxesState(false);
}
},
unlock() {
if (this.wakeLock) {
this.wakeLock.release();
this.wakeLock = false;
}
this.setCheckboxesState(false);
}
};

(function(callback) {
if (document.readyState !== “loading”) {
callback();
} else {
document.addEventListener(“DOMContentLoaded”, callback);
}
})(() => {
window.TastyRecipes.cookMode.init();
});

window.TastyRecipes = window.TastyRecipes || {};

window.TastyRecipes.staticTooltip = {
element: null,
tooltipElement: null,
deleting: false,
init( element ) {
if ( this.deleting ) {
return;
}
this.element = element;
this.buildElements();
},
destroy() {
if ( ! this.tooltipElement || this.deleting ) {
return;
}

this.deleting = true;
this.tooltipElement.classList.remove( ‘opened’ );

setTimeout( () => {
this.tooltipElement.remove();
this.deleting = false;
}, 500 );
},
buildElements() {
const tooltipElement = document.createElement( ‘div’ );
tooltipElement.classList.add( ‘tasty-recipes-static-tooltip’);
tooltipElement.setAttribute( ‘id’, ‘tasty-recipes-tooltip’ );

const currentTooltipElement = document.getElementById( ‘tasty-recipes-tooltip’ );
if ( currentTooltipElement ) {
document.body.replaceChild( tooltipElement, currentTooltipElement );
} else {
document.body.appendChild( tooltipElement );
}

this.tooltipElement = document.getElementById( ‘tasty-recipes-tooltip’ );
},
show() {
if ( ! this.tooltipElement ) {
return;
}

const tooltipTop = this.element.getBoundingClientRect().top
+ window.scrollY
– 10 // 10px offset.
– this.tooltipElement.getBoundingClientRect().height;
const tooltipLeft = this.element.getBoundingClientRect().left
– ( this.tooltipElement.getBoundingClientRect().width / 2 )
+ ( this.element.getBoundingClientRect().width / 2 ) – 1;
const posLeft = Math.max( 10, tooltipLeft );
this.maybeRemoveTail( posLeft !== tooltipLeft );

this.tooltipElement.setAttribute( ‘style’, ‘top:’ + tooltipTop + ‘px;left:’ + posLeft + ‘px;’ );
this.tooltipElement.classList.add( ‘opened’ );

},
maybeRemoveTail( removeTail ) {
if ( removeTail ) {
this.tooltipElement.classList.add( ‘tr-hide-tail’ );
} else {
this.tooltipElement.classList.remove( ‘tr-hide-tail’ );
}
},
changeMessage( message ) {
if ( ! this.tooltipElement ) {
return;
}
this.tooltipElement.innerHTML = message;
}
};

window.TastyRecipes.ajax = {
sendPostRequest( url, data, success, failure ) {
const xhr = new XMLHttpRequest();
xhr.open( ‘POST’, url, true );
xhr.send( this.preparePostData( data ) );

xhr.onreadystatechange = () => {
if ( 4 !== xhr.readyState ) {
return;
}
if ( xhr.status === 200 ) {
success( JSON.parse( xhr.responseText ) );
return;
}

failure( xhr );
};

xhr.onerror = () => {
failure( xhr );
};
},
preparePostData( data ) {
const formData = new FormData();

for ( const key in data ) {
formData.append( key, data[key] );
}
return formData;
},
};

window.TastyRecipes.ratings = {
defaultRating: 0,
currentRatingPercentage: 100,
savingRating: false,
init( minRating ) {
this.minRating = minRating;

this.formWatchRating();
this.closeTooltipWhenClickOutside();
this.addBodyClassBasedOnSelectedRating();
this.backwardCompFormRatingPosition();
},
formWatchRating() {
const ratings = document.querySelectorAll(‘.tasty-recipes-no-ratings-buttons [data-rating]’);
if ( ratings.length {
event.preventDefault();
this.defaultRating = event.target.closest( ‘.checked’ ).dataset.rating;
this.setCheckedStar( event.target );
this.maybeSendRating( this.defaultRating, event.target );
this.setRatingInForm( this.defaultRating );
} );
}
},
closeTooltipWhenClickOutside() {
window.addEventListener( ‘click’, e => {
// Bailout (don’t remove the tooltip) when the clicked element is a rating star, or it’s the tooltip itself.
if ( e.target.closest( ‘.tasty-recipes-rating’ ) || e.target.classList.contains( ‘tasty-recipes-static-tooltip’ ) ) {
return;
}

window.TastyRecipes.staticTooltip.destroy();
} );
},
setRatingInForm( rating ) {
const ratingInput = document.querySelector( ‘#respond .tasty-recipes-rating[value=”‘ + rating + ‘”]’ );
if ( ! ratingInput ) {
return;
}
ratingInput.click();
},
addBodyClassBasedOnSelectedRating() {
const ratingInputs = document.querySelectorAll( ‘input.tasty-recipes-rating’ );
if ( ! ratingInputs ) {
return;
}
for ( const ratingInput of ratingInputs ) {
ratingInput.addEventListener( ‘click’, currentEvent => {
const selectedRating = currentEvent.target.getAttribute( ‘value’ );
this.handleBodyClassByRating( selectedRating );
this.toggleCommentTextareaRequired( selectedRating );
} );
}
},
handleBodyClassByRating( rating ) {
if ( rating < this.minRating ) {
document.body.classList.remove( 'tasty-recipes-selected-minimum-rating' );
return;
}
document.body.classList.add( 'tasty-recipes-selected-minimum-rating' );
},
toggleCommentTextareaRequired( rating ) {
const commentTextarea = document.getElementById( 'comment' );
if ( ! commentTextarea ) {
return;
}

if ( rating {
window.TastyRecipes.staticTooltip.changeMessage( response.data.message );
window.TastyRecipes.staticTooltip.show();
this.updateAverageText( response.data, recipeCardElement );
this.maybeFillCommentForm( response.data );

// Hide the tooltip after 5 seconds.
setTimeout( () => {
this.maybeResetTooltip( recipeCardElement, response.data, rating );
}, 5000 );
},
() => {
this.resetTooltip( recipeCardElement );
}
);
},
updateAverageText( data, recipeCardElement ) {
if ( ! data.average ) {
return;
}
this.setRatingPercent( data );

if ( ! data.count ) {
return;
}

const quickLink = document.querySelector( ‘.tasty-recipes-rating-link’ );
if ( quickLink ) {
this.setTextInContainer( quickLink, data );
this.setPartialStar( quickLink );
}

const cardStars = recipeCardElement.querySelector( ‘.tasty-recipes-ratings-buttons’ );
cardStars.dataset.trDefaultRating = data.average;
this.setTextInContainer( recipeCardElement.querySelector( ‘.tasty-recipes-rating’ ), data );
},
setTextInContainer( container, data ) {
if ( ! container ) {
return;
}

if ( data.label ) {
const ratingLabelElement = container.querySelector( ‘.rating-label’ );
if ( ratingLabelElement ) {
ratingLabelElement.innerHTML = data.label;
}
return;
}

const averageElement = container.querySelector( ‘.average’ );
if ( averageElement ) {
averageElement.textContent = data.average;
}

const countElement = container.querySelector( ‘.count’ );
if ( countElement ) {
countElement.textContent = data.count;
}
},
setPartialStar( container ) {
const highestStar = container.querySelector( ‘[data-rating=”‘ + Math.ceil( this.defaultRating ) + ‘”]’ );
if ( highestStar ) {
highestStar.dataset.trClip = this.currentRatingPercentage;
}
},
setRatingPercent( data ) {
this.defaultRating = data.average.toFixed( 1 );
const parts = data.average.toFixed( 2 ).toString().split( ‘.’ );
this.currentRatingPercentage = parts[1] ? parts[1] : 100;
if ( this.currentRatingPercentage === ’00’ ) {
this.currentRatingPercentage = 100;
}
},
setCheckedStar( target ) {
const cardRatingContainer = target.closest( ‘.tasty-recipes-ratings-buttons’ );
const selectedRatingElement = cardRatingContainer.querySelector( ‘[data-tr-checked]’ );
if ( selectedRatingElement ) {
delete selectedRatingElement.dataset.trChecked;
}

const thisStar = target.closest( ‘.tasty-recipes-rating’ );
thisStar.dataset.trChecked = 1;
thisStar.querySelector( ‘[data-tr-clip]’ ).dataset.trClip = 100;
},
maybeFillCommentForm( data ) {
if ( ! data.comment || ! data.comment.content ) {
return;
}

const commentForm = document.querySelector( ‘#commentform’ );
if ( ! commentForm ) {
return;
}

const commentBox = commentForm.querySelector( ‘[name=comment]’ );
if ( ! commentBox || commentBox.value ) {
return;
}

// Add comment details for editing.
commentBox.innerHTML = data.comment.content;
if ( data.comment.name ) {
commentForm.querySelector( ‘[name=author]’ ).value = data.comment.name;
commentForm.querySelector( ‘[name=email]’ ).value = data.comment.email;
}
},
maybeResetTooltip( recipeCardElement, data, rating ) {
if ( this.savingRating === rating ) {
this.resetTooltip( recipeCardElement, data );
}
},
resetTooltip( recipeCardElement, data ) {
window.TastyRecipes.staticTooltip.destroy();
this.savingRating = false;

// Reset the default rating.
const cardRatingContainer = recipeCardElement.querySelector( ‘.tasty-recipes-ratings-buttons’ );
if ( cardRatingContainer ) {
this.defaultRating = ( data && data.average ) ? data.average.toFixed(1) : cardRatingContainer.dataset.trDefaultRating;
cardRatingContainer.dataset.trDefaultRating = this.defaultRating;

this.resetSelectedStar( cardRatingContainer, data );
}
},
resetSelectedStar( cardRatingContainer ) {
const selectedRatingElement = cardRatingContainer.querySelector( ‘[data-rating=”‘ + Math.ceil( this.defaultRating ) + ‘”]’ );
if ( selectedRatingElement ) {
selectedRatingElement.querySelector( ‘[data-tr-clip]’ ).dataset.trClip = this.currentRatingPercentage;
selectedRatingElement.parentNode.dataset.trChecked = 1;
}

const previousSelectedElement= cardRatingContainer.querySelector( ‘[data-tr-checked]’ );
if ( previousSelectedElement ) {
const currentSelectedRating = previousSelectedElement.querySelector(‘[data-rating]’);
if ( currentSelectedRating !== selectedRatingElement ) {
delete previousSelectedElement.dataset.trChecked;
}
}
},
backwardCompFormRatingPosition() {
const ratingsButtons = document.querySelector( ‘#respond .tasty-recipes-ratings-buttons, #tasty-recipes-comment-rating .tasty-recipes-ratings-buttons’ );
if ( ! ratingsButtons ) {
return;
}
const ratingsButtonsStyles = window.getComputedStyle(ratingsButtons);
if ( ! ratingsButtonsStyles.display.includes( ‘flex’ ) ) {
ratingsButtons.style.direction = ‘rtl’;
}

if ( typeof tastyRecipesRating !== ‘undefined’ ) {
// Select the rating that was previously selected in admin.
ratingsButtons.querySelector( ‘.tasty-recipes-rating[value=”‘ + tastyRecipesRating + ‘”]’ ).checked = true;
}

const ratingSpans = ratingsButtons.querySelectorAll( ‘.tasty-recipes-rating’ );
for (const ratingSpan of ratingSpans) {
ratingSpan.addEventListener( ‘click’, event => {
if ( ratingSpan === event.target ) {
return;
}
ratingSpan.previousElementSibling.click();
} );
}
}
};

(function(callback) {
if (document.readyState !== “loading”) {
callback();
} else {
window.addEventListener( ‘load’, callback );
}
})(() => {
window.TastyRecipes.ratings.init( window.trCommon ? window.trCommon.minRating : 4 );
});

The post Elote Inspired Pizza appeared first on Baking the Goods.

Exit mobile version