diff --git a/assets/js/sccp_manager.js b/assets/js/sccp_manager.js index 5ea8f4c..6f41438 100644 --- a/assets/js/sccp_manager.js +++ b/assets/js/sccp_manager.js @@ -1057,7 +1057,7 @@ function sleep(milliseconds) } $(".sccp-restore").click(function() { - //input is sent by data-for where for is an attribute + //input is sent by data-for where for as an attribute var id = $(this).data("for"), input = $("#" + id); var edit_style = document.getElementById("edit_" + id).style; @@ -1066,9 +1066,11 @@ $(".sccp-restore").click(function() { return; } if ($(this).is(":checked")) { + console.log('restore/checked'); edit_style.display = 'block'; input.prop("readonly", true); } else { + console.log('restore/unchecked'); edit_style.display = 'none'; input.data("custom", input.val()); input.prop("readonly", true); @@ -1077,20 +1079,36 @@ $(".sccp-restore").click(function() { }); $(".sccp-edit").click(function() { - //input is sent by data-for where for is an attribute - var id = $(this).data("for"), input = $("#" + id); + var id = $(this).data("for"), input = $("#" + id); var edit_style = document.getElementById("edit_" + id).style; + //input is sent by data-for where for is an attribute + if ($(this).data("type") === 'radio') { + input = 'radio'; + console.log('have radio type'); + // $(':radio:not(:checked)').attr('disabled', true); to make readonly + // Need to use getElementBy Name + } + + console.log(input); if (input.length === 0) { return; } if ($(this).is(":checked")) { + console.log('edit/checked'); edit_style.display = 'block'; + if (input == 'radio') { + return; + } input.prop("readonly", false); input.focus(); } else { + console.log('edit/unchecked'); edit_style.display = 'none'; + if (input == 'radio') { + return; + } input.data("custom", input.val()); input.prop("readonly", true); input.val(input.data("default")); diff --git a/views/formShowSysDefs.php b/views/formShowSysDefs.php index 9c5da6b..f913457 100644 --- a/views/formShowSysDefs.php +++ b/views/formShowSysDefs.php @@ -403,6 +403,8 @@ foreach ($items as $child) { $res_sec_class =''; if (!empty($child ->class)) { $res_sec_class = (string)$child ->class; + } else { + $res_sec_class = 'sccp-custom'; } echo ''; @@ -411,7 +413,7 @@ foreach ($items as $child) {