mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-24 08:53:37 +01:00
Move load from XML call for easier testing
This commit is contained in:
parent
c113e93656
commit
723c18bd64
@ -366,7 +366,7 @@ export class Et2Template extends Et2Widget(LitElement)
|
||||
// Ask the server for the template
|
||||
if(!xml)
|
||||
{
|
||||
let templates = await et2_loadXMLFromURL(this.getUrl(), null, this, this.loadFailed);
|
||||
let templates = await this.loadFromFile(this.getUrl());
|
||||
|
||||
// Scan the file for templates and store them
|
||||
let fallback;
|
||||
@ -393,6 +393,19 @@ export class Et2Template extends Et2Widget(LitElement)
|
||||
return xml;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the xml from the given file
|
||||
*
|
||||
* Broken out here so it can be stubbed for testing
|
||||
*
|
||||
* @param path
|
||||
* @returns {Promise<Element | void>}
|
||||
* @protected
|
||||
*/
|
||||
protected loadFromFile(path)
|
||||
{
|
||||
return et2_loadXMLFromURL(path, null, this, this.loadFailed);
|
||||
}
|
||||
/**
|
||||
* The template has been loaded, wait for child widgets to be complete.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user