mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-08-16 11:38:02 +02:00
WIP Mail REST API: change calendar to use new egw.openDialog():
- renamed app.dialogExec() to app.openDialog() or egw.openDialog() - the later is the nicer place, but fails for lost window context with popups :(
This commit is contained in:
@ -378,6 +378,32 @@ egw.extend('open', egw.MODULE_WND_LOCAL, function(_egw, _wnd)
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 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: function(_menuaction)
|
||||
{
|
||||
return this.json(_menuaction.match(/^([^.:]+)/)[0] + '.jdots_framework.ajax_exec.template.' + _menuaction,
|
||||
['index.php?menuaction=' + _menuaction, true], _response =>
|
||||
{
|
||||
if (Array.isArray(_response) && typeof _response[0] === 'string')
|
||||
{
|
||||
jQuery(_response[0]).appendTo(_wnd.document.body);
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log("Invalid response to dialogExec('"+_menuaction+"')", _response);
|
||||
}
|
||||
}).sendRequest();
|
||||
},
|
||||
|
||||
/**
|
||||
* Open a (centered) popup window with given size and url
|
||||
*
|
||||
@ -690,4 +716,4 @@ try {
|
||||
}
|
||||
} catch (e) {}
|
||||
});
|
||||
*/
|
||||
*/
|
Reference in New Issue
Block a user