mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-08-14 10:28:31 +02:00
Fix some typescript bugs
- Don't default dialog width so the automatic calculations run - Setting etemplate_exec_id after load doesn't work, moved to passing it in. Fixes several file select issues
This commit is contained in:
@ -1072,7 +1072,18 @@ var et2_vfsSelect = /** @class */ (function (_super) {
|
||||
}
|
||||
}
|
||||
buttons.push({ text: egw.lang("Close"), id: "close", image: "cancel" });
|
||||
var data = jQuery.extend(_data, { 'currentapp': egw(window).app_name() });
|
||||
// Don't rely only on app_name to fetch et2 object as app_name may not
|
||||
// always represent current app of the window, e.g.: mail admin account.
|
||||
// Try to fetch et2 from its template name.
|
||||
var etemplate = jQuery('form').data('etemplate');
|
||||
var et2;
|
||||
if (etemplate && etemplate.name && !app[egw(window).app_name()]) {
|
||||
et2 = etemplate2.getByTemplate(etemplate.name)[0];
|
||||
}
|
||||
else {
|
||||
et2 = etemplate2.getByApplication(egw(window).app_name())[0];
|
||||
}
|
||||
var data = jQuery.extend(_data, { 'currentapp': egw(window).app_name(), etemplate_exec_id: et2.etemplate_exec_id });
|
||||
// define a mini app object for vfs select UI
|
||||
app.vfsSelectUI = new app.classes.vfsSelectUI;
|
||||
// callback for dialog
|
||||
@ -1146,26 +1157,15 @@ var et2_vfsSelect = /** @class */ (function (_super) {
|
||||
this.dialog.template.uniqueId = 'api.vfsSelectUI';
|
||||
app.vfsSelectUI.et2 = this.dialog.template.widgetContainer;
|
||||
app.vfsSelectUI.vfsSelectWidget = this;
|
||||
// Don't rely only on app_name to fetch et2 object as app_name may not
|
||||
// always represent current app of the window, e.g.: mail admin account.
|
||||
// Try to fetch et2 from its template name.
|
||||
var etemplate = jQuery('form').data('etemplate');
|
||||
var et2;
|
||||
if (etemplate && etemplate.name && !app[egw(window).app_name()]) {
|
||||
et2 = etemplate2.getByTemplate(etemplate.name)[0];
|
||||
}
|
||||
else {
|
||||
et2 = etemplate2.getByApplication(egw(window).app_name())[0];
|
||||
}
|
||||
// we need an etemplate_exec_id for better handling serverside parts of
|
||||
// widgets and since we can not have a etemplate_exec_id specifically
|
||||
// for dialog template our best shot is to inherit its parent etemplate_exec_id.
|
||||
this.dialog.template.etemplate_exec_id = et2.etemplate_exec_id;
|
||||
// Keep the dialog always at the top
|
||||
this.dialog.div.parent().css({ "z-index": 100000 });
|
||||
this.dialog.div.on('load', function (e) {
|
||||
app.vfsSelectUI.et2_ready(app.vfsSelectUI.et2, 'api.vfsSelectUI');
|
||||
});
|
||||
// we need an etemplate_exec_id for better handling serverside parts of
|
||||
// widgets and since we can not have a etemplate_exec_id specifically
|
||||
// for dialog template our best shot is to inherit its parent etemplate_exec_id.
|
||||
this.dialog.template.etemplate_exec_id = et2.etemplate_exec_id;
|
||||
};
|
||||
/**
|
||||
* Set recent path into sessionStorage
|
||||
|
Reference in New Issue
Block a user