D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
raptqcnr
/
www
/
wp-content
/
themes
/
woodmart
/
js
/
scripts
/
wc
/
Filename :
waitlistTable.min.js
back
Copy
woodmartThemeModule.waitlistTable=function(){var o=document.querySelector(".wd-wtl-table");o&&o.querySelectorAll(".wd-wtl-unsubscribe").forEach(function(e){e.addEventListener("click",function(e){e.preventDefault();var t=this;o.parentNode.querySelector(".wd-loader-overlay").classList.add("wd-loading"),jQuery.ajax({url:woodmart_settings.ajaxurl,data:{action:"woodmart_remove_from_waitlist_in_my_account",product_id:t.dataset.productId},method:"POST",success:function(e){e&&(e.success&&t.closest("tr").remove(),e.data.content)&&((tempDiv=document.createElement("div")).innerHTML=e.data.content,e=tempDiv.querySelector(".wd-wtl-content").childNodes,o.parentNode.replaceChildren(...e))},error:function(){console.error("ajax remove from waitlist error")},complete:function(){o.parentNode.querySelector(".wd-loader-overlay").classList.remove("wd-loading")}})})})},window.addEventListener("load",function(){woodmartThemeModule.waitlistTable()});