mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-08-13 18:17:07 +02:00
WIP new app.ts method dialogExec(_menuaction) opening a popup into a dialog
ToDo: overwrite Framework actions in etemplate2.handle_load() to eg. close dialog, but not window, or refresh window instead of opener
This commit is contained in:
@ -747,6 +747,29 @@ export abstract class EgwApp
|
||||
this.et2_view.close = destroy;
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens _menuaction in an Et2Dialog
|
||||
*
|
||||
* @param _menuaction
|
||||
* @return Promise<any>
|
||||
*/
|
||||
dialogExec(_menuaction : string)
|
||||
{
|
||||
const ajax = this.egw.json(_menuaction.match(/^([^.:]+)/)[0] + '.jdots_framework.ajax_exec.template.' + _menuaction,
|
||||
['index.php?menuaction=' + _menuaction], _response =>
|
||||
{
|
||||
if (Array.isArray(_response) && typeof _response[0] === 'string')
|
||||
{
|
||||
jQuery(_response[0]).appendTo(document.body);
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log("Invalid response to dialogExec('"+_menuaction+"')", _response);
|
||||
}
|
||||
});
|
||||
return ajax.sendRequest();
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge selected entries into template document
|
||||
*
|
||||
|
Reference in New Issue
Block a user