diff --git a/api/js/etemplate/Et2Dialog/Et2Dialog.ts b/api/js/etemplate/Et2Dialog/Et2Dialog.ts index 5a671bda7f..f076b6280c 100644 --- a/api/js/etemplate/Et2Dialog/Et2Dialog.ts +++ b/api/js/etemplate/Et2Dialog/Et2Dialog.ts @@ -847,8 +847,12 @@ export class Et2Dialog extends Et2Widget(SlotMixin(SlDialog)) { // Check for something with buttons slot set let search_in = (this._template_widget?.DOMContainer || this._contentNode); + if(!search_in) + { + return; + } let template_buttons = [ - ...search_in.querySelectorAll('[slot="buttons"]'), + ...search_in.querySelectorAll('[slot="footer"],[slot="buttons"]'), // Look for a dialog footer, which will contain several buttons and possible other widgets ...search_in.querySelectorAll(".dialogFooterToolbar"), // Look for buttons at high level (not everywhere, otherwise we can't have other buttons in the template) @@ -856,11 +860,17 @@ export class Et2Dialog extends Et2Widget(SlotMixin(SlDialog)) ]; if(template_buttons) { + if(template_buttons[0].instanceOf(Et2Button)) + { + template_buttons[0].variant = "primary"; + template_buttons[0].outline = true; + } template_buttons.forEach((button) => { button.setAttribute("slot", "footer"); this.appendChild(button); - }) + }); + this.requestUpdate(); } // do NOT submit dialog, if it has no etemplate_exec_id, it only gives and error on server-side if (this._template_widget && !this._template_widget.widgetContainer.getInstanceManager().etemplate_exec_id) diff --git a/calendar/js/app.ts b/calendar/js/app.ts index 0ed32a2de7..4487e15cc9 100644 --- a/calendar/js/app.ts +++ b/calendar/js/app.ts @@ -2088,12 +2088,11 @@ export class CalendarApp extends EgwApp return false; } // Insert the content into the correct place - add_dialog._contentNode.remove(); - add_dialog.insertAdjacentHTML("beforeend", content.html); + add_dialog._contentNode.replaceChildren(); + add_dialog._contentNode.insertAdjacentHTML("beforeend", content.html); let template = add_dialog.querySelector("[id='calendar-add']"); if(template) { - template.slot = ""; template.addEventListener("load", add_dialog._adoptTemplateButtons); } } @@ -2158,7 +2157,7 @@ export class CalendarApp extends EgwApp if(invalid.filter((widget) => widget).length == 0) { // Close the dialog, if everything is OK - (document.querySelector('et2-dialog#quick_add')).close(); + (document.querySelector('et2-dialog#quick_add')).hide(); } }); diff --git a/calendar/templates/default/add.xet b/calendar/templates/default/add.xet index fd327906ab..fefe743acc 100644 --- a/calendar/templates/default/add.xet +++ b/calendar/templates/default/add.xet @@ -28,17 +28,16 @@ - -