Created
July 7, 2015 23:26
-
-
Save jermspeaks/707c0e5a5e94225a0d9d to your computer and use it in GitHub Desktop.
hosts js file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Mark attendance activation after email send callback | |
*/ | |
function toggleEventAttendance() { | |
$('.email-sent-btn').on('click', function(e) { | |
e.preventDefault(); | |
console.log(e); | |
var form = $(e.target.form); | |
$.ajax({ | |
type: form.attr('method'), | |
url: form.attr('action'), | |
data: form.serialize(), | |
dataType: 'json', //Not sure why this is required | |
success: function(data) { | |
var id = data.tea_time.id; | |
$("[data-tea-time-id='"+id+"'] > h3.tasks.email").attr('class', 'tasks email complete') | |
$(e.target).parents('.subtask-container').html("<p class='subtask'>All done, thanks!</p>") | |
}, | |
error: function(data) { alert('Uh-oh. You shouldn\'t be seeing this.'); } | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment