Advertisement
Anthonylacra

Untitled

Aug 25th, 2019
423
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function release() {
  2.     // OUT OF CARD BEHAVIOR
  3.     if (index === 1) {
  4.       document.querySelector('.user_card').innerHTML = "Plus de profil disponible"
  5.     }
  6.  
  7.     if (pullDeltaX >= decisionVal) {
  8.         const id = $card.attr("id")
  9.  
  10.         fetch(`http://localhost:8888/Adopteunstage-main/public/interns/likeEnterprise&enterprise_id=${id}&intern_id=${<?= $_SESSION['user_id']?>}`)
  11.        
  12.         $card.addClass("to-right");
  13.     } else if (pullDeltaX <= -decisionVal) {
  14.         const id = $card.attr("id")
  15.  
  16.         $card.addClass("to-left");
  17.     }
  18.  
  19.     if (Math.abs(pullDeltaX) >= decisionVal) {
  20.         $card.addClass("inactive");
  21.  
  22.         setTimeout(function() {
  23.           index--
  24.           $card.addClass("hidden");
  25.         }, 300);
  26.     }
  27.  
  28.     if (Math.abs(pullDeltaX) < decisionVal) {
  29.         $card.addClass("reset");
  30.     }
  31.  
  32.     setTimeout(function() {
  33.         $card.attr("style", "").removeClass("reset")
  34.           .find(".demo__card__choice").attr("style", "");
  35.  
  36.         pullDeltaX = 0;
  37.         animating = false;
  38.     }, 300);
  39. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement