Hi everyone,
I have following code to show Modal:
self.Delete = function (product) {
var $deleteModal = $('#deleteModal');
$deleteModal.on("show", function () {
$deleteModal.find('#btnConfirmDelete').on("click", function
(e) {
// odstranění produktu na serveru
App.DataServices.AjaxRequest({
url: '/api/products/' + product.ID,
method: App.DataServices.HttpMethod.Delete,
data: { id: product.ID },
success: function () {
$deleteModal.modal('hide');
self.Products.remove(product);
}
});
});
});
$deleteModal.modal('show');
};
But if I open the window and then I close it. I repeat it few times. Then
the ajax request is fires many times.
Could you help me why? I would like to fire the ajax just once.
Thank you for your replies.
--
You received this message because you are subscribed to the Google Groups
"twitter-bootstrap" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.