Last active
August 29, 2015 13:55
-
-
Save kirkbushell/8712761 to your computer and use it in GitHub Desktop.
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
var registration = { | |
create: function() { | |
var status = null; | |
var data = { | |
id: '', | |
status: '' | |
}; | |
this.setStatus = function(value) { | |
data.status = value; | |
}; | |
this.setId = function(value) { | |
data.id = value; | |
}; | |
this.updateStatus = function(url, callback) { | |
jQuery.ajax({ | |
url: url, | |
type: 'POST', | |
data: data, | |
success: function(data) { | |
window.location = callback; | |
} | |
}); | |
}; | |
}, | |
updateHandler: function() { | |
var url = jQuery(this).data('url'); | |
var callback = jQuery(this).data('callback'); | |
var status = jQuery(this).data('status'); | |
var id = jQuery(this).data('id'); | |
var temp = new registration.create(); | |
temp.setStatus(status); | |
temp.setId(id); | |
temp.updateStatus(url, callback); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment