bongzilla

Untitled

Jan 14th, 2021
900
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $( document ).ready(function() {
  2.     const wishlistDiv = $("a[href='/wishlist']").eq(0);
  3.  
  4.     if(Number($('[data-wc="wl_count"]')[0].innerText) === 0) {
  5.         $('[data-wc="wl_count"]').eq(0).hide();
  6.     }
  7.  
  8.     $(".action.wishlst").on("click", function(e) {
  9.         console.log("wishlist clicked");
  10.         const wishlistCount = $('[data-wc="wl_count"]').eq(0);
  11.  
  12.         setTimeout(() => {
  13.             let count = $('[data-wc="wl_count"]')[0].innerText;
  14.             console.log("count is", count);
  15.  
  16.             if(count > 0) {
  17.                 wishlistCount.show();
  18.             } else {
  19.                 wishlistCount.hide();
  20.             }
  21.  
  22.         }, 2500)
  23.     });
  24. });
RAW Paste Data