Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).on({click: function(){
- var privacyValue = $(this).attr('data-change-privacy');
- var privacyId = $(this).attr('data-id');
- $.ajax({
- type: "POST",
- data: { link_id: privacyId, privacy: privacyValue },
- dataType: "text",
- url: "/privacyUpdate"
- });
- if (privacyValue == "1") {
- $(this).html("<i class="fa fa-lock"></i>Private");
- $(this).attr("data-change-privacy","0"); // NEW
- }
- else {
- $(this).html("<i class="fa fa-globe"></i>Public");
- $(this).attr("data-change-privacy","1"); // NEW
- }
- $.notify("Privacy updated.", { position: "bottom right", className: "success" });
- }},'h2.privacy');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement