brotherton-erpnext/erpnext/website/page/unsubscribe/unsubscribe.js

21 lines
531 B
JavaScript
Raw Normal View History

2012-01-27 12:30:14 +00:00
pscript.onload_unsubscribe = function(wrapper) {
var email = window.location.hash.split('/').splice(-1);
$(wrapper).find('input[name="unsubscribe"]').val(email)
$('#btn-unsubscribe').click(function() {
var email = $(wrapper).find('input[name="unsubscribe"]').val();
if(email) {
var btn = this;
wn.call({
module:'website',
page:'unsubscribe',
method:'unsubscribe',
args:email,
btn: this,
callback: function() {
$(wrapper).find('input[name="unsubscribe"]').val('');
}
});
}
});
}