diff --git a/includes/html/pages/device/edit/ports.inc.php b/includes/html/pages/device/edit/ports.inc.php index 9461bf13b4..3d05fd10f9 100644 --- a/includes/html/pages/device/edit/ports.inc.php +++ b/includes/html/pages/device/edit/ports.inc.php @@ -125,30 +125,24 @@ $('#disable-select').on("click", function (event) { // select all disable buttons event.preventDefault(); - $('.disable-check').prop('checked', true); - //TODO: find a better solution for 'select-all' button refresh - $('.disable-check').trigger('click'); - $('.disable-check').trigger('click'); + $('.disable-check').bootstrapSwitch('state', true); }); $('#ignore-select').on("click", function (event) { // select all ignore buttons event.preventDefault(); - $('.ignore-check').prop('checked', true); - //TODO: find a better solution for 'select-all' button refresh - $('.ignore-check').trigger('click'); - $('.ignore-check').trigger('click'); + $('.ignore-check').bootstrapSwitch('state', true); }); $('#down-select').on("click", function (event) { // select ignore buttons for all ports which are down event.preventDefault(); $('[id^="operstatus_"]').each(function () { - var name = $(this).attr('name'); + var name = $(this).attr('id'); var text = $(this).text(); - if (name && text == 'down') { + if (name && text === 'down') { // get the interface number from the object name var port_id = name.split('_')[1]; - // find its corresponding checkbox and toggle it - $('input[name="ignore_' + port_id + '"]').trigger('click'); + // find its corresponding checkbox and enable it + $('input[name="ignore_' + port_id + '"]').bootstrapSwitch('state', true); } }); }); @@ -156,12 +150,12 @@ // toggle ignore buttons for all ports which are in class red event.preventDefault(); $('.red').each(function () { - var name = $(this).attr('name'); + var name = $(this).attr('id'); if (name) { // get the interface number from the object name var port_id = name.split('_')[1]; - // find its corresponding checkbox and toggle it - $('input[name="ignore_' + port_id + '"]').trigger('click'); + // find its corresponding checkbox and enable it + $('input[name="ignore_' + port_id + '"]').bootstrapSwitch('state', true); } }); });