Advertisement
Guest User

Untitled

a guest
Jul 25th, 2014
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. $(document).on({click: function(){
  2. var privacyValue = $(this).attr('data-change-privacy');
  3. var privacyId = $(this).attr('data-id');
  4. $.ajax({
  5. type: "POST",
  6. data: { link_id: privacyId, privacy: privacyValue },
  7. dataType: "text",
  8. url: "/privacyUpdate"
  9. });
  10. if (privacyValue == "1") {
  11. $(this).html("<i class="fa fa-lock"></i>Private");
  12. $(this).attr("data-change-privacy","0"); // NEW
  13. }
  14. else {
  15. $(this).html("<i class="fa fa-globe"></i>Public");
  16. $(this).attr("data-change-privacy","1"); // NEW
  17. }
  18. $.notify("Privacy updated.", { position: "bottom right", className: "success" });
  19. }},'h2.privacy');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement