mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 16:03:47 +01:00
WIP Mail REST API: fix reported problems with calendar quick add
This commit is contained in:
parent
15cf0ca1ff
commit
efaa3ae386
@ -1022,7 +1022,7 @@ export class Et2Dialog extends Et2Widget(SlotMixin(SlDialog))
|
|||||||
|
|
||||||
get _contentNode() : HTMLElement
|
get _contentNode() : HTMLElement
|
||||||
{
|
{
|
||||||
return this.querySelector('.dialog_content') ?? this.querySelector("*");
|
return this.querySelector('.dialog_content');
|
||||||
}
|
}
|
||||||
|
|
||||||
_setupMoveResize()
|
_setupMoveResize()
|
||||||
|
@ -1516,7 +1516,13 @@ export class etemplate2
|
|||||||
// Check the parameters
|
// Check the parameters
|
||||||
const data = _response.data;
|
const data = _response.data;
|
||||||
// window-close does NOT send data.DOMNodeID!
|
// window-close does NOT send data.DOMNodeID!
|
||||||
const dialog = <any>document.querySelector('et2-dialog > form'+(data.DOMNodeID?'#'+data.DOMNodeID:''))?.parentNode;
|
const dialog = <any>document.querySelector('et2-dialog > form'+(data.DOMNodeID?'#'+data.DOMNodeID:'.dialog_content'))?.parentNode;
|
||||||
|
|
||||||
|
if (dialog)
|
||||||
|
{
|
||||||
|
// stop dialogs from being closed on button click
|
||||||
|
dialog.callback = () => false;
|
||||||
|
}
|
||||||
|
|
||||||
// handle Api\Framework::refresh_opener()
|
// handle Api\Framework::refresh_opener()
|
||||||
if(Array.isArray(data['refresh-opener']))
|
if(Array.isArray(data['refresh-opener']))
|
||||||
|
13
api/js/jsapi/egw_global.d.ts
vendored
13
api/js/jsapi/egw_global.d.ts
vendored
@ -1121,6 +1121,19 @@ declare interface IegwWndLocal extends IegwGlobal
|
|||||||
*/
|
*/
|
||||||
open_link(_link : string, _target? : string, _popup? : string, _target_app? : string,
|
open_link(_link : string, _target? : string, _popup? : string, _target_app? : string,
|
||||||
_check_popup_blocker? : boolean, _mime_type? : string) : Window|void;
|
_check_popup_blocker? : boolean, _mime_type? : string) : Window|void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Opens a menuaction in an Et2Dialog instead of a popup
|
||||||
|
*
|
||||||
|
* Please note:
|
||||||
|
* This method does NOT (yet) work in popups, only in the main EGroupware window!
|
||||||
|
* For popups you have to use the app.ts method openDialog(), which creates the dialog in the correct window / popup.
|
||||||
|
*
|
||||||
|
* @param string _menuaction
|
||||||
|
* @return Promise<any>
|
||||||
|
*/
|
||||||
|
openDialog(_menuaction : string) : Promise<any>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Open a (centered) popup window with given size and url
|
* Open a (centered) popup window with given size and url
|
||||||
*
|
*
|
||||||
|
@ -260,7 +260,7 @@ class Etemplate extends Etemplate\Widget\Template
|
|||||||
{
|
{
|
||||||
if ($output_mode == 2)
|
if ($output_mode == 2)
|
||||||
{
|
{
|
||||||
$content = '<et2-dialog><form target="egw_iframe_autocomplete_helper" action="'.$form_action.'" id="'.$dom_id.'" class="et2_container"></form></et2-dialog>'."\n";
|
$content = '<et2-dialog><form target="egw_iframe_autocomplete_helper" action="'.$form_action.'" id="'.$dom_id.'" class="et2_container dialog_content"></form></et2-dialog>'."\n";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2062,7 +2062,31 @@ export class CalendarApp extends EgwApp
|
|||||||
{
|
{
|
||||||
menuaction += '&'+name+'='+encodeURIComponent(options[name]);
|
menuaction += '&'+name+'='+encodeURIComponent(options[name]);
|
||||||
}
|
}
|
||||||
return this.egw.openDialog(menuaction);
|
return this.egw.openDialog(menuaction).then(_dialog =>
|
||||||
|
{
|
||||||
|
// it would be much nicer if openDialog returns Promise<ET2Dialog>, so we can use it, without searching the dialog
|
||||||
|
// in a window.setTimeout in the DOM ...
|
||||||
|
window.setTimeout(() =>
|
||||||
|
{
|
||||||
|
const dialog = document.querySelector('et2-dialog > form.dialog_content')?.parentNode;
|
||||||
|
if (dialog)
|
||||||
|
{
|
||||||
|
dialog.callback = _button =>
|
||||||
|
{
|
||||||
|
if (event)
|
||||||
|
{
|
||||||
|
event.destroy();
|
||||||
|
}
|
||||||
|
// a little quicker than waiting for the server to close it
|
||||||
|
if (_button === "calendar-add_button[cancel]")
|
||||||
|
{
|
||||||
|
dialog.hide();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, 500);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user