BUG: Choosing Business Hours Bad javascript
-
Everytime you select a start time for business hours it hides the end time.
admin/scripts/admin.js
Your bug is in this function, please reviewvar $form = $('#business-hours'); jQuery(document).on("click", ".bup_select_start", function(e) { //$('.bup_select_start').on('change', function () { var $row = $(this).parent(), $end_select = $('.bup_select_end', $row), $start_select = $(this); if ($start_select.val()) { $end_select.show(); $('span', $row).show(); var start_time = $start_select.val(); $('span > option', $end_select).each(function () { $(this).unwrap(); }); // Hides end time options with value less than in the start time $('option', $end_select).each(function () { if ($(this).val() <= start_time) { $(this).wrap("<span>").parent().hide(); } }); if (start_time >= $end_select.val()) { $('option:visible:first', $end_select).attr('selected', true); } } else { // OFF $end_select.hide(); $('span', $row).hide(); } }).each(function () { var $row = $(this).parent(), $end_select = $('.bup_select_end', $row); $(this).data('default_value', $(this).val()); $end_select.data('default_value', $end_select.val()); // Hides end select for "OFF" days if (!$(this).val()) { $end_select.hide(); $('span', $row).hide(); } }).trigger('change');
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘BUG: Choosing Business Hours Bad javascript’ is closed to new replies.