Fixed demo buttons.

see #204
This commit is contained in:
Antoine Nguyen
2012-04-04 21:23:34 +02:00
parent 273b24ebe5
commit 36ed0449b4
3 changed files with 26 additions and 5 deletions
+2
View File
@@ -1,6 +1,8 @@
$(document).ready(function() {
$(document).on('click', 'a[data-toggle="ajaxmodal"]', modalbox);
$(document).on('click', 'a[data-toggle="ajaxmodal-autowidth"]', modalbox_autowidth);
$(document).on('click', 'a[name=sendspam]', simple_ajax_request);
$(document).on('click', 'a[name=sendvirus]', simple_ajax_request);
//parse_menubar('#topmenubar');
//parse_menubar('#menubar');
+19
View File
@@ -201,4 +201,23 @@ function chpasswordform_cb() {
error_cb: chpasswordform_cb
});
});
}
/*
* Send a simple AJAX request.
*/
function simple_ajax_request(e) {
var $this = $(this);
e.preventDefault();
$.ajax({
url: $this.attr("herf"),
dataType: 'json',
success: function(data) {
if (data.status == "ok") {
$("body").notify("success", data.respmsg, 2000);
} else {
$("body").notify("error", data.respmsg);
}
}
});
}