Replace direct 'click' event binding with delegated binding. Fixes #58.

Direct binding only works for elements already in the DOM, delegated
binding works for all elements that match a filter even if created after
the DOM is fully loaded.
This commit is contained in:
Ivan Filippov
2016-07-01 16:31:14 -06:00
parent b286d8a9ad
commit 9794e221aa
6 changed files with 17 additions and 20 deletions

View File

@ -223,14 +223,13 @@
"info" : false,
"autoWidth" : false
});
$(".history-info-button").click(function() {
$(document.body).on('click', '.history-info-button', function() {
var modal = $("#modal_history_info");
var info = $(this).val();
modal.find('.modal-body p').text(info);
modal.modal('show');
});
$(document).on("click", ".button_dnssec", function() {
$(document.body).on("click", ".button_dnssec", function() {
var domain = $(this).prop('id');
getdnssec('/domain/' + domain + '/dnssec');
});