This straightforward focaccia bread recipe has crispy edges, a fluffy crumb, and a wealthy olive oil taste. Easy substances, versatile timing, and massive Italian taste!

The primary time I pulled a pan of selfmade focaccia out of my oven, I couldn’t imagine how one thing this good may come from such easy substances! This bread comes out thick and ethereal, crispy on the skin with pillowy air pockets on the inside, with taste notes of salt, rosemary and olive oil.
My husband Alex and I developed this bread recipe collectively, and it shortly grew to become one in every of our favourite straightforward bread recipes as a result of you will get unimaginable taste with minimal effort. It has a excessive hydration dough that creates stunning air bubbles, and a superb quantity of olive oil to provide it a wealthy taste. One of the best half is you want minimal gear and no baking expertise!
Why You’ll Love This Recipe
If a focaccia recipe isn’t formulated accurately, it could actually come out very dense, with no holes within the crumb, skinny or dry, or fluffy and delicate like a roll. Right here’s why you’ll love this recipe:
- The bread is thick and crisp on the skin, good for consuming plain or slicing in half as sandwiches.
- It has a gorgeous ethereal crumb, which comes from an in a single day rise.
- It’s bought a developed, well-seasoned taste that tastes prefer it’s from an Italian bakery!
- You want minimal hands-on time: Simply 5 minutes to combine, 5 minutes to form, and also you’re achieved with lively work
5-Star Reader Evaluations




“We completely love this recipe! It’s so straightforward and so tasty. As we speak, I made it as a half-batch in an 8×8 pan. I take advantage of a rosemary sea salt within the brine once I don’t have recent rosemary.” –Lisa D.




“This bread was perfection! My household beloved it! I’ve tried a number of focaccia recipes, and this by far is the perfect. I cooked it in a forged iron skillet – so fairly when it was turned out.” –Margie B.

What You’ll Want
One of many nice issues about selfmade focaccia? You want only some substances and minimal bread-making instruments. A lot of my bread recipes require a Dutch oven, bread basket, particular knife for scoring, and different gear. Right here’s what you’ll want for this recipe:
- Bread flour: Bread flour has the next protein content material than all-purpose flour, which makes for a lighter, airier texture. It’s price discovering for this recipe!
- Energetic dry yeast: Use lively dry yeast, not on the spot. You may retailer it within the freezer between makes use of.
- Olive oil and salt: The oil brings a wealthy taste and crispy exterior.
- Recent rosemary: Recent rosemary is conventional in Italian baking of focaccia and it provides simply the correct herbaceous scent to the recent bread.
- 9 x 13″ baking dish: That is used for baking the bread.
- Kitchen scale (non-obligatory): Whereas it’s non-obligatory, I extremely advocate weighing the substances for greatest outcomes while you’re baking
- Pizza stone (non-obligatory): It helps to warmth the bread faster and make an airier dough. Right here’s the pizza stone I take advantage of. (It’s also possible to use it for these pizza recipes and different breads, so it’s an excellent funding.)
How you can Make Focaccia Bread
Focaccia bread is an Italian flatbread baked in a sheet pan and flavored with olive oil. A superb focaccia ought to be thick and ethereal, with these signature air pockets within the crumb (inside texture). It’s just like pizza dough however is made utilizing a bread flour and extra yeast, which makes it taller and fluffier.
Focaccia is among the best bread recipes I’ve, however you do have to suppose forward! Right here’s an outline of the steps required (or bounce to the recipe to get began):
- Combine the dough (5 minutes). Combine the substances in a bowl: the dough can be moist and sticky, which is what you need.
- Relaxation in a single day (12 to 16 hours). Cowl the bowl tightly with plastic wrap or place it in a big zip-top bag. Relaxation at room temperature in a single day.
- Form within the baking pan (5 minutes). Drizzle olive oil right into a 9×13 inch steel baking pan. Add the dough to the pan and with oiled arms, gently press and stretch the dough towards the corners of the pan. Be mild so that you don’t deflate the air bubbles.
- Second rise (45 minutes). Cowl with plastic and relaxation at room temperature. In the meantime, preheat your oven to 425°F.
- Create the brine and dimple (5 minutes). Combine the brine substances: olive oil, water, and kosher salt. Pour this combination over the dough. Then use your fingertips to press into the dough and create dimples throughout the complete floor of the dough.
- Bake till golden brown (35 minutes). Bake for 30-35 minutes, till the highest is deeply golden brown and the perimeters are crispy.
- Step 8: Cool (45 minutes). That is the toughest half! Let the focaccia cool utterly within the pan earlier than slicing. Cooling permits the construction to set and makes slicing a lot simpler.

Timing Choices: Similar-Day or In a single day
In a single day (Most well-liked):
This offers you the perfect taste and most open crumb. I often combine the dough round 9:00 pm, let it rise in a single day on the counter, then form and bake round 1:00 pm the following day. The lengthy fermentation at room temperature develops depth of taste and makes a extra complicated taste than quick-rise strategies.
Similar-Day (When Time is Brief):
Combine the dough within the morning, let it rise for 2-3 hours at room temperature, then form, proof for 45 minutes, and bake. It gained’t have fairly the depth of taste of the in a single day model, however it’s nonetheless higher than store-bought and simple for same-day bread.
Toppings, Add-Ins, & Variations
Topping Variations
You may add many toppings to focaccia bread along with the traditional rosemary and sea salt. Listed here are a number of concepts (all added after dimpling, earlier than baking):
- Cherry tomatoes
- Caramelized onions
- Sliced olives
- Solar-dried tomatoes
- Thinly sliced pink onion rings
- Grated Parmesan cheese
Pan Variations
It’s also possible to change up the pan sizes:
- Sheet pan focaccia: Use a rimmed baking sheet for a thinner, crispier focaccia
- Forged iron skillet: Makes a spherical focaccia with particularly crispy edges
- 8×8 pan: Use half the recipe for a smaller batch (good for 2-3 individuals)

Serving Concepts
That stunning loaf of focaccia bread will make your kitchen odor like a bakery. When you can resist, wait till it’s totally cool to take a style. Nonetheless, such a bread gained’t undergo for those who attempt to sneak a chunk when it’s heat (which is a no-no with sourdough bread). Focaccia works served by itself as a facet for lunch, dinner, or soups, or sliced for sandwiches. Listed here are a number of methods to serve focaccia bread:
- As a facet for Italian meals
- As a facet for soup
- Sliced on a cheese board or antipasto platter
- As an Italian appetizer
- Sliced for a sandwich like Caprese Sandwich, Italian Eggplant Sandwich or Salmon Sandwich
- For vacation appetizers or sides like Thanksgiving or Christmas
Storing & Reheating Leftovers
You may retailer selfmade focaccia bread for as much as 3 days in a sealed plastic bag with extra air squeezed out, or in a sealed container. It’s nice room temperature or you’ll be able to reheat it in a 375°F oven till heat.
Focaccia freezes for as much as 3 months. Let it cool utterly, then wrap tightly in plastic wrap adopted by aluminum foil. Freeze in slices or as an entire loaf. To thaw, depart it at room temperature for 2-3 hours, then bake in a 350°F oven for 10 minutes.
Dietary Notes
This focaccia recipe is vegetarian, vegan, plant-based, and dairy-free.
Ceaselessly Requested Questions
Focaccia is an Italian flatbread with a excessive olive oil content material, dimpled floor, and ethereal crumb construction. It makes use of excessive hydration (a lot of water relative to flour) which creates giant, irregular air bubbles all through. The beneficiant olive oil each within the dough and on prime provides focaccia its signature wealthy taste and crispy exterior. The dimpling method creates pockets that fill with olive oil and seasonings, making each chew flavorful and textured.
The key to nice focaccia comes down to a few issues: excessive hydration dough, beneficiant olive oil, and correct fermentation time. Excessive hydration (a moist, sticky dough) creates the air pockets and lightweight texture. Good high quality olive oil offers the wealthy taste that makes focaccia particular. Lastly, giving the dough ample rise time (12-16 hours for in a single day, or no less than 2-3 hours for same-day) is vital for the perfect fluffy texture
For the primary rise, use 12-16 hours at room temperature. The second rise after shaping ought to be about 45 minutes. If focaccia over-proofs, the dough can grow to be too relaxed, leading to a flatter loaf with much less top. Over-proofed dough appears to be like very puffy however deflates when touched. In case your dough over-proofs barely, it’s often nonetheless fantastic to bake: simply deal with it gently.
Sure! Sourdough focaccia provides great tangy taste. Go to this Sourdough Focaccia recipe. I even have a full Sourdough Bread Recipe if you wish to discover sourdough baking additional.
Use high-quality additional virgin olive oil. It’s also possible to add recent or dried herbs to the dough itself, not simply on prime. One other concept is to brush the baked focaccia with garlic-infused olive oil whereas it’s nonetheless sizzling. You may add Parmesan cheese sprinkled on prime, or Incorporate sun-dried tomatoes, olives, or caramelized onions into the dough.
Focaccia Bread Recipe
This straightforward focaccia bread recipe has crispy edges, a fluffy crumb, and a wealthy olive oil taste. Easy substances, versatile timing, and massive Italian taste!
- Prep Time: 12 hours
- Prepare dinner Time: 35 minutes
- Complete Time: 12 hours 35 minutes
- Yield: 18
- Class: Bread
- Methodology: Baked
- Delicacies: Italian
- Weight loss program: Vegan
Components
For the bread
- 630 grams (4 ½ cups) bread flour
- 1 ½ teaspoons lively dry yeast
- 2 teaspoons kosher salt
- 532 ml (2 ¼ cups) heat water
- 1 ½ tablespoons olive oil
For the brine
- 2 tablespoons olive oil
- 1 tablespoon water
- 1 teaspoon kosher salt
For topping
- Leaves from 2 rosemary sprigs
Directions
- In a big bowl, stir collectively the flour, yeast and kosher salt. Add the nice and cozy water and 1 ½ tablespoons olive oil and stir with a picket spoon till sticky dough is shaped. With moist arms, carry the underside of the dough and wrap it excessive a number of occasions, folding the dough to make a ball and to make sure all the flour has been included. Place the dough again within the bowl and cover the bowl tightly with plastic wrap or place in a big zip-top bag.
- Proof in a single day at room temperature, ideally 12 to 16 hours. The dough will rise and double in measurement, after which collapse. (For instance, we like to combine at 9:00 pm and begin the baking course of at 1:00 pm the following day.)
- After the rise, add a small drizzle of olive oil right into a 9″ x 13″ steel baking pan and use your arms to unfold it throughout the underside. Together with your oiled arms, flip the dough into the baking pan and gently press and stretch the dough in order that it’s evenly distributed throughout the pan (take care to not smash all the air out of the dough). It could take a number of occasions of stretching it out to achieve the corners. Cowl the pan with plastic wrap or a big zip-top bag and relaxation for 45 minutes.
- Preheat the oven to 425 levels Fahrenheit with a pizza stone inside. You may nonetheless bake with out the pizza stone, however it should yield an airier dough.
- In a small bowl, stir collectively the brine substances.
- Pour the brine over the puffy dough and evenly press your fingers into the dough, all the best way throughout, to dimple the dough. Sprinkle with rosemary leaves.
- Bake instantly: place the pan on the pizza stone and bake for 30 to 35 minutes till golden brown on prime. Cool utterly earlier than chopping. Retailer as much as 3 days in a sealed plastic bag with extra air squeezed out or a sealed container.
Notes
Freezing notes: Focaccia freezes for as much as 3 months. Let it cool utterly, then wrap tightly in plastic wrap adopted by aluminum foil. Freeze in slices or as an entire loaf. To thaw, depart it at room temperature for 2-3 hours, then bake in a 350°F oven for 10 minutes.
Variations and add ins: Strive topping the dough with sliced cherry tomatoes, caramelized onions, sundried tomatoes, or Parmesan cheese.
(operate(){
window.addEventListener( ‘message’, operate( occasion ){
if ( ( ‘https://nutrifox.com’ !== occasion.origin && ‘https://nutrifox.take a look at’ !== occasion.origin ) ||
typeof occasion.information !== ‘string’ ) {
return;
}
var payload = JSON.parse( occasion.information );
change ( payload.occasion ) {
case ‘setHeight’:
var iframe = doc.getElementById( ‘nutrifox-label-‘ + payload.recipeId );
iframe.fashion.top = payload.top + ‘px’;
break;
}
} );
}());
window.trCommon={“minRating”:6,”ajaxurl”:”https://www.acouplecooks.com/wp-admin/admin-ajax.php”,”ratingNonce”:””,”postId”:135606};
window.TastyRecipes = window.TastyRecipes || {};
window.TastyRecipes.smoothScroll = {
init() {
doc.addEventListener( ‘click on’, ( e ) => {
let anchor = e.goal;
if ( anchor.tagName !== ‘A’ ) {
anchor = anchor.closest( ‘a.tasty-recipes-scrollto’ );
}
if ( ! anchor || ! anchor.classList.comprises( ‘tasty-recipes-scrollto’ ) ) {
return;
}
const elementHref = anchor.getAttribute( ‘href’ );
if ( ! elementHref ) {
return;
}
e.preventDefault();
this.goToSelector( elementHref );
});
},
goToSelector( selector ) {
const aspect = doc.querySelector( selector );
if ( ! aspect ) {
return;
}
aspect.scrollIntoView( { habits: ‘easy’ } );
}
};
doc.addEventListener(
‘DOMContentLoaded’,
() => window.TastyRecipes.smoothScroll.init()
);
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 = doc.querySelectorAll(this.cookModeSelector);
if (cookModes.size > 0) {
for (const cookMode of cookModes) {
if (this.wakeLockApi) {
cookMode.querySelector(‘enter[type=”checkbox”]’).addEventListener(“change”, occasion => {
this.checkboxChange(occasion.goal);
}, false);
} else {
cookMode.fashion.show = “none”;
}
}
}
},
checkboxChange(checkbox) {
if (checkbox.checked) {
this.lock();
} else {
this.unlock();
}
},
setCheckboxesState(state) {
const checkboxes = doc.querySelectorAll(this.cookModeSelector + ‘ enter[type=”checkbox”]’);
for (const checkbox of checkboxes) {
checkbox.checked = state;
}
},
async lock() {
strive {
this.wakeLock = await this.wakeLockApi.request(“display”);
this.wakeLock.addEventListener(“launch”, () => {
this.wakeLock = false;
this.setCheckboxesState(false);
});
this.setCheckboxesState(true);
} catch (error) {
this.setCheckboxesState(false);
}
},
unlock() {
if (this.wakeLock) {
this.wakeLock.launch();
this.wakeLock = false;
}
this.setCheckboxesState(false);
}
};
(operate(callback) {
if (doc.readyState !== “loading”) {
callback();
} else {
doc.addEventListener(“DOMContentLoaded”, callback);
}
})(() => {
window.TastyRecipes.cookMode.init();
});
window.TastyRecipes = window.TastyRecipes || {};
window.TastyRecipes.staticTooltip = {
aspect: null,
tooltipElement: null,
deleting: false,
init( aspect ) {
if ( this.deleting ) {
return;
}
this.aspect = aspect;
this.buildElements();
},
destroy() {
if ( ! this.tooltipElement || this.deleting ) {
return;
}
this.deleting = true;
this.tooltipElement.classList.take away( ‘opened’ );
setTimeout( () => {
this.tooltipElement.take away();
this.deleting = false;
}, 500 );
},
buildElements() {
const tooltipElement = doc.createElement( ‘div’ );
tooltipElement.classList.add( ‘tasty-recipes-static-tooltip’);
tooltipElement.setAttribute( ‘id’, ‘tasty-recipes-tooltip’ );
const currentTooltipElement = doc.getElementById( ‘tasty-recipes-tooltip’ );
if ( currentTooltipElement ) {
doc.physique.replaceChild( tooltipElement, currentTooltipElement );
} else {
doc.physique.appendChild( tooltipElement );
}
this.tooltipElement = doc.getElementById( ‘tasty-recipes-tooltip’ );
},
present() {
if ( ! this.tooltipElement ) {
return;
}
const tooltipTop = this.aspect.getBoundingClientRect().prime
+ window.scrollY
– 10 // 10px offset.
– this.tooltipElement.getBoundingClientRect().top;
const tooltipLeft = this.aspect.getBoundingClientRect().left
– ( this.tooltipElement.getBoundingClientRect().width / 2 )
+ ( this.aspect.getBoundingClientRect().width / 2 ) – 1;
const posLeft = Math.max( 10, tooltipLeft );
this.maybeRemoveTail( posLeft !== tooltipLeft );
this.tooltipElement.setAttribute( ‘fashion’, ‘prime:’ + 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.take away( ‘tr-hide-tail’ );
}
},
changeMessage( message ) {
if ( ! this.tooltipElement ) {
return;
}
this.tooltipElement.innerHTML = message;
}
};
window.TastyRecipes.ajax = {
sendPostRequest( url, information, success, failure ) {
const xhr = new XMLHttpRequest();
xhr.open( ‘POST’, url, true );
xhr.ship( this.preparePostData( information ) );
xhr.onreadystatechange = () => {
if ( 4 !== xhr.readyState ) {
return;
}
if ( xhr.standing === 200 ) {
success( JSON.parse( xhr.responseText ) );
return;
}
failure( xhr );
};
xhr.onerror = () => {
failure( xhr );
};
},
preparePostData( information ) {
const formData = new FormData();
for ( const key in information ) {
formData.append( key, information[key] );
}
return formData;
},
};
window.TastyRecipes.rankings = {
defaultRating: 0,
currentRatingPercentage: 100,
savingRating: false,
init( minRating ) {
this.minRating = minRating;
this.formWatchRating();
this.closeTooltipWhenClickOutside();
this.addBodyClassBasedOnSelectedRating();
this.backwardCompFormRatingPosition();
},
formWatchRating() {
const rankings = doc.querySelectorAll(‘.tasty-recipes-no-ratings-buttons [data-rating]’);
if ( rankings.size {
occasion.preventDefault();
this.defaultRating = occasion.goal.closest( ‘.checked’ ).dataset.ranking;
this.setCheckedStar( occasion.goal );
this.maybeSendRating( this.defaultRating, occasion.goal );
this.setRatingInForm( this.defaultRating );
} );
}
},
closeTooltipWhenClickOutside() {
window.addEventListener( ‘click on’, e => {
// Bailout (do not take away the tooltip) when the clicked aspect is a ranking star, or it is the tooltip itself.
if ( e.goal.closest( ‘.tasty-recipes-rating’ ) || e.goal.classList.comprises( ‘tasty-recipes-static-tooltip’ ) ) {
return;
}
window.TastyRecipes.staticTooltip.destroy();
} );
},
setRatingInForm( ranking ) {
const ratingInput = doc.querySelector( ‘#reply .tasty-recipes-rating[value=”‘ + rating + ‘”]’ );
if ( ! ratingInput ) {
return;
}
ratingInput.click on();
},
addBodyClassBasedOnSelectedRating() {
const ratingInputs = doc.querySelectorAll( ‘enter.tasty-recipes-rating’ );
if ( ! ratingInputs ) {
return;
}
for ( const ratingInput of ratingInputs ) {
ratingInput.addEventListener( ‘click on’, currentEvent => {
const selectedRating = currentEvent.goal.getAttribute( ‘worth’ );
this.handleBodyClassByRating( selectedRating );
this.toggleCommentTextareaRequired( selectedRating );
} );
}
},
handleBodyClassByRating( ranking ) {
if ( ranking < this.minRating ) {
doc.physique.classList.take away( 'tasty-recipes-selected-minimum-rating' );
return;
}
doc.physique.classList.add( 'tasty-recipes-selected-minimum-rating' );
},
toggleCommentTextareaRequired( ranking ) {
const commentTextarea = doc.getElementById( 'remark' );
if ( ! commentTextarea ) {
return;
}
if ( ranking {
window.TastyRecipes.staticTooltip.changeMessage( response.information.message );
window.TastyRecipes.staticTooltip.present();
this.updateAverageText( response.information, recipeCardElement );
this.maybeFillCommentForm( response.information );
// Disguise the tooltip after 5 seconds.
setTimeout( () => {
this.maybeResetTooltip( recipeCardElement, response.information, ranking );
}, 5000 );
},
() => {
this.resetTooltip( recipeCardElement );
}
);
},
updateAverageText( information, recipeCardElement ) {
if ( ! information.common ) {
return;
}
this.setRatingPercent( information );
if ( ! information.rely ) {
return;
}
const quickLink = doc.querySelector( ‘.tasty-recipes-rating-link’ );
if ( quickLink ) {
this.setTextInContainer( quickLink, information );
this.setPartialStar( quickLink );
}
const cardStars = recipeCardElement.querySelector( ‘.tasty-recipes-ratings-buttons’ );
cardStars.dataset.trDefaultRating = information.common;
this.setTextInContainer( recipeCardElement.querySelector( ‘.tasty-recipes-rating’ ), information );
},
setTextInContainer( container, information ) {
if ( ! container ) {
return;
}
if ( information.label ) {
const ratingLabelElement = container.querySelector( ‘.rating-label’ );
if ( ratingLabelElement ) {
ratingLabelElement.innerHTML = information.label;
}
return;
}
const averageElement = container.querySelector( ‘.common’ );
if ( averageElement ) {
averageElement.textContent = information.common;
}
const countElement = container.querySelector( ‘.rely’ );
if ( countElement ) {
countElement.textContent = information.rely;
}
},
setPartialStar( container ) {
const highestStar = container.querySelector( ‘[data-rating=”‘ + Math.ceil( this.defaultRating ) + ‘”]’ );
if ( highestStar ) {
highestStar.dataset.trClip = this.currentRatingPercentage;
}
},
setRatingPercent( information ) {
this.defaultRating = information.common.toFixed( 1 );
const components = information.common.toFixed( 2 ).toString().cut up( ‘.’ );
this.currentRatingPercentage = components[1] ? components[1] : 100;
if ( this.currentRatingPercentage === ’00’ ) {
this.currentRatingPercentage = 100;
}
},
setCheckedStar( goal ) {
const cardRatingContainer = goal.closest( ‘.tasty-recipes-ratings-buttons’ );
const selectedRatingElement = cardRatingContainer.querySelector( ‘[data-tr-checked]’ );
if ( selectedRatingElement ) {
delete selectedRatingElement.dataset.trChecked;
}
const thisStar = goal.closest( ‘.tasty-recipes-rating’ );
thisStar.dataset.trChecked = 1;
thisStar.querySelector( ‘[data-tr-clip]’ ).dataset.trClip = 100;
},
maybeFillCommentForm( information ) {
if ( ! information.remark || ! information.remark.content material ) {
return;
}
const commentForm = doc.querySelector( ‘#commentform’ );
if ( ! commentForm ) {
return;
}
const commentBox = commentForm.querySelector( ‘[name=comment]’ );
if ( ! commentBox || commentBox.worth ) {
return;
}
// Add remark particulars for modifying.
commentBox.innerHTML = information.remark.content material;
if ( information.remark.identify ) {
commentForm.querySelector( ‘[name=author]’ ).worth = information.remark.identify;
commentForm.querySelector( ‘[name=email]’ ).worth = information.remark.e mail;
}
},
maybeResetTooltip( recipeCardElement, information, ranking ) {
if ( this.savingRating === ranking ) {
this.resetTooltip( recipeCardElement, information );
}
},
resetTooltip( recipeCardElement, information ) {
window.TastyRecipes.staticTooltip.destroy();
this.savingRating = false;
// Reset the default ranking.
const cardRatingContainer = recipeCardElement.querySelector( ‘.tasty-recipes-ratings-buttons’ );
if ( cardRatingContainer ) {
this.defaultRating = ( information && information.common ) ? information.common.toFixed(1) : cardRatingContainer.dataset.trDefaultRating;
cardRatingContainer.dataset.trDefaultRating = this.defaultRating;
this.resetSelectedStar( cardRatingContainer, information );
}
},
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 = doc.querySelector( ‘#reply .tasty-recipes-ratings-buttons, #tasty-recipes-comment-rating .tasty-recipes-ratings-buttons’ );
if ( ! ratingsButtons ) {
return;
}
const ratingsButtonsStyles = window.getComputedStyle(ratingsButtons);
if ( ! ratingsButtonsStyles.show.consists of( ‘flex’ ) ) {
ratingsButtons.fashion.route = ‘rtl’;
}
if ( typeof tastyRecipesRating !== ‘undefined’ ) {
// Choose the ranking that was beforehand chosen 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 on’, occasion => {
if ( ratingSpan === occasion.goal ) {
return;
}
ratingSpan.previousElementSibling.click on();
} );
}
}
};
(operate(callback) {
if (doc.readyState !== “loading”) {
callback();
} else {
window.addEventListener( ‘load’, callback );
}
})(() => {
window.TastyRecipes.rankings.init( window.trCommon ? window.trCommon.minRating : 4 );
});
