Skip to content

Commit

Permalink
Add a callback to the feedback show function
Browse files Browse the repository at this point in the history
  • Loading branch information
pierre-alain committed Mar 5, 2012
1 parent e4b527a commit bb3bae0
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions feedback.js
Expand Up @@ -46,7 +46,11 @@ window.FeedbackOptions = jQuery.extend({
emailInvalidError: 'Please provide a valid email',
feedbackMissingError: 'Please type in feedback',
feedbackAjaxSuccess: 'We have received your feedback. Thank you!',
feedbackAjaxError: 'There was an error.'
feedbackAjaxError: 'There was an error.',

// When the user opens the window
callback: function(){}

}, window.FeedbackOptions || {});

jQuery(document).ready(function() {
Expand Down Expand Up @@ -176,7 +180,7 @@ jQuery(document).ready(function() {
.addClass('error')
.html(options.feedbackMissingError)
.delay(3000).fadeOut(1000, function() {
$(this).empty().show();
$(this).html(' ').removeClass('error ok').show();
});
return false;
}
Expand Down Expand Up @@ -248,6 +252,10 @@ jQuery(document).ready(function() {
return true;
});

if(options.callback){
options.callback(content_em);
}

return false;
};

Expand Down

0 comments on commit bb3bae0

Please sign in to comment.