mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-02 20:19:18 +01:00
Get vfsSelect dialog working again
This commit is contained in:
parent
5e2b690b2a
commit
21da0b067a
@ -502,6 +502,17 @@ export class Et2Dialog extends Et2Widget(ScopedElementsMixin(SlotMixin(LionDialo
|
|||||||
this.__value.content = {};
|
this.__value.content = {};
|
||||||
}
|
}
|
||||||
this._template_widget = new etemplate2(this._overlayContentNode._contentNode);
|
this._template_widget = new etemplate2(this._overlayContentNode._contentNode);
|
||||||
|
|
||||||
|
// Fire an event so consumers can do their thing - etemplate will fire its own load event when its done
|
||||||
|
if(!this.dispatchEvent(new CustomEvent("before-load", {
|
||||||
|
bubbles: true,
|
||||||
|
cancelable: true,
|
||||||
|
detail: this._template_widget
|
||||||
|
})))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if(this.__template.indexOf('.xet') > 0)
|
if(this.__template.indexOf('.xet') > 0)
|
||||||
{
|
{
|
||||||
// File name provided, fetch from server
|
// File name provided, fetch from server
|
||||||
@ -532,7 +543,7 @@ export class Et2Dialog extends Et2Widget(ScopedElementsMixin(SlotMixin(LionDialo
|
|||||||
this._template_widget.DOMContainer.setAttribute('id', this.__template.replace(/^(.*\/)?([^/]+?)(\.xet)?(\?.*)$/, '$2').replace(/\./g, '-'));
|
this._template_widget.DOMContainer.setAttribute('id', this.__template.replace(/^(.*\/)?([^/]+?)(\.xet)?(\?.*)$/, '$2').replace(/\./g, '-'));
|
||||||
|
|
||||||
// Look for buttons after load
|
// Look for buttons after load
|
||||||
this._templateWidget.addEventListener("load", this._adoptTemplateButtons.bind(this));
|
this.addEventListener("load", this._adoptTemplateButtons);
|
||||||
}
|
}
|
||||||
|
|
||||||
render()
|
render()
|
||||||
|
@ -1336,8 +1336,8 @@ export class et2_vfsSelect extends et2_inputWidget
|
|||||||
let self = this;
|
let self = this;
|
||||||
let buttons = [
|
let buttons = [
|
||||||
{
|
{
|
||||||
text: egw.lang(_data.content.label),
|
label: egw.lang(_data.content.label),
|
||||||
id:"submit",
|
id: "submit",
|
||||||
image: _data.content.mode.match(/saveas|select-dir/) ? "save" : this.options.button_icon
|
image: _data.content.mode.match(/saveas|select-dir/) ? "save" : this.options.button_icon
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
@ -1353,7 +1353,7 @@ export class et2_vfsSelect extends et2_inputWidget
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
buttons.push({text: egw.lang("Close"), id:"close", image:"cancel"});
|
buttons.push({label: egw.lang("Close"), id: "close", image: "cancel"});
|
||||||
|
|
||||||
|
|
||||||
// Don't rely only on app_name to fetch et2 object as app_name may not
|
// Don't rely only on app_name to fetch et2 object as app_name may not
|
||||||
@ -1461,15 +1461,19 @@ export class et2_vfsSelect extends et2_inputWidget
|
|||||||
buttons: buttons,
|
buttons: buttons,
|
||||||
minWidth: 500,
|
minWidth: 500,
|
||||||
minHeight: 400,
|
minHeight: 400,
|
||||||
width:400,
|
width: 400,
|
||||||
value: data,
|
value: data,
|
||||||
template: egw.webserverUrl+'/api/templates/default/vfsSelectUI.xet?1',
|
template: egw.webserverUrl + '/api/templates/default/vfsSelectUI.xet?1',
|
||||||
resizable: false
|
resizable: false
|
||||||
});
|
});
|
||||||
document.body.appendChild(<HTMLElement><unknown>this.dialog);
|
this.dialog.addEventListener("before-load", (ev) =>
|
||||||
|
{
|
||||||
this.dialog.template.uniqueId = 'api.vfsSelectUI';
|
this.dialog.template.uniqueId = 'api.vfsSelectUI';
|
||||||
|
});
|
||||||
|
document.body.appendChild(<HTMLElement><unknown>this.dialog);
|
||||||
|
|
||||||
this.dialog.on('open', function(e) {
|
this.dialog.addEventListener('open', function(e)
|
||||||
|
{
|
||||||
app.vfsSelectUI.et2 = self.dialog.template.widgetContainer;
|
app.vfsSelectUI.et2 = self.dialog.template.widgetContainer;
|
||||||
app.vfsSelectUI.vfsSelectWidget = self;
|
app.vfsSelectUI.vfsSelectWidget = self;
|
||||||
app.vfsSelectUI.et2_ready(app.vfsSelectUI.et2, 'api.vfsSelectUI');
|
app.vfsSelectUI.et2_ready(app.vfsSelectUI.et2, 'api.vfsSelectUI');
|
||||||
|
Loading…
Reference in New Issue
Block a user