mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2025-06-14 12:06:06 +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:
@ -74,13 +74,12 @@
|
||||
"info" : true,
|
||||
"autoWidth" : false
|
||||
});
|
||||
|
||||
$(".setting-toggle-button").click(function() {
|
||||
$(document.body).on('click', '.setting-toggle-button', function() {
|
||||
var setting = $(this).prop('id');
|
||||
applyChanges('','/admin/setting/' + setting + '/toggle', false, true)
|
||||
});
|
||||
|
||||
$(".setting-save-button").click(function() {
|
||||
$(document.body).on('click', '.setting-save-button', function() {
|
||||
var setting = $(this).prop('id');
|
||||
var value = $(this).parents('tr').find('#value')[0].value;
|
||||
var postdata = {'value': value};
|
||||
|
Reference in New Issue
Block a user