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:
ralf
2023-07-13 15:22:21 +02:00
parent 6ce0abdb37
commit 3e27def4f9
7 changed files with 65 additions and 190 deletions

View File

@ -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) {}
});
*/
*/