fix: fix popup blocker and Select2 error when prefilling calendar

- Open window synchronously before await to avoid popup blocker,
  then navigate it to /Calendar/View after successful save; close
  it if the save fails
- Guard the #customer Select2 change handler so it bails early
  when #customer has not been initialized as Select2 yet

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-27 13:46:19 +01:00
co-authored by Claude Sonnet 4.6
parent daf1ce3401
commit a53ff3912c
2 changed files with 16 additions and 6 deletions
+2
View File
@@ -2378,6 +2378,8 @@ $(document).ready(function () {
$('body').on('change', '#customer,#customer-info-type', function () {
if (!$('#customer').hasClass('select2-hidden-accessible')) return;
if ($('#name').val() == "") {
$('#name').val('IBN: ' + $("#customer").select2('data')[0].name);
}