Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
File Manager
/
wp-content
/
themes
/
oceanwp
/
assets
/
src
/
js
/
wp-plugins
/
woocommerce
/
custom-features
:
reset-variations.js
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
class WooResetVariations { #elements = { resetVariations: document.querySelector(".reset_variations"), }; constructor() { if (!!this.#elements.resetVariations) { this.#setupEventListeners(); } } #setupEventListeners = () => { this.#elements.resetVariations.addEventListener("click", (event) => { const resetVariations = event.currentTarget; resetVariations .closest(".variations") .querySelectorAll("select") .forEach((select) => { setTimeout(() => { select.nextSibling.innerHTML = select.options[select.selectedIndex].text; }, 100); }); }); }; } export default WooResetVariations;