mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2025-07-29 16:53:44 +00:00
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:
@@ -84,7 +84,7 @@
|
||||
});
|
||||
|
||||
// handle revocation of privileges
|
||||
$('.button_revoke').click(function() {
|
||||
$(document.body).on('click', '.button_revoke', function() {
|
||||
var modal = $("#modal_revoke");
|
||||
var username = $(this).prop('id');
|
||||
var info = "Are you sure you want to revoke all privileges for " + username + ". They will not able to access any domain.";
|
||||
@@ -97,7 +97,7 @@
|
||||
modal.modal('show');
|
||||
});
|
||||
// handle deletion of user
|
||||
$('.button_delete').click(function() {
|
||||
$(document.body).on('click', '.button_delete', function() {
|
||||
var modal = $("#modal_delete");
|
||||
var username = $(this).prop('id');
|
||||
var info = "Are you sure you want to delete " + username + "?";
|
||||
@@ -118,7 +118,7 @@
|
||||
});
|
||||
|
||||
// handle checkbox toggling
|
||||
$('.admin_toggle').on('ifToggled', function(event) {
|
||||
$(document.body).on('ifToggled', '.admin_toggle', function() {
|
||||
var is_admin = $(this).prop('checked');
|
||||
var username = $(this).prop('id');
|
||||
postdata = {
|
||||
|
Reference in New Issue
Block a user