mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
@@ -209,17 +209,19 @@ QWeb.addDirective({
|
||||
ctx.addIf(`slot${slotKey}`);
|
||||
let parentNode = `c${ctx.parentNode}`;
|
||||
if (!ctx.parentNode) {
|
||||
ctx.rootContext.shouldDefineResult = true;
|
||||
ctx.rootContext.shouldDefineUtils = true;
|
||||
parentNode = `children${ctx.nextID++}`;
|
||||
ctx.addLine(`let ${parentNode}= []`);
|
||||
ctx.addLine(`result = {}`);
|
||||
ctx.rootContext.shouldDefineResult = true;
|
||||
ctx.rootContext.shouldDefineUtils = true;
|
||||
parentNode = `children${ctx.nextID++}`;
|
||||
ctx.addLine(`let ${parentNode}= []`);
|
||||
ctx.addLine(`result = {}`);
|
||||
}
|
||||
ctx.addLine(
|
||||
`slot${slotKey}.call(this, context.__owl__.parent, Object.assign({}, extra, {parentNode: ${parentNode}, vars: extra.vars, parent: owner}));`
|
||||
);
|
||||
if (!ctx.parentNode) {
|
||||
ctx.addLine(`Promise.all(extra.promises).then(() => utils.defineProxy(result, ${parentNode}[0]))`);
|
||||
ctx.addLine(
|
||||
`Promise.all(extra.promises).then(() => utils.defineProxy(result, ${parentNode}[0]))`
|
||||
);
|
||||
}
|
||||
ctx.closeIf();
|
||||
return true;
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@
|
||||
*
|
||||
* - whenReady
|
||||
* - loadJS
|
||||
* - loadTemplates
|
||||
* - loadFile
|
||||
* - escape
|
||||
* - debounce
|
||||
*/
|
||||
@@ -43,7 +43,7 @@ export function loadJS(url: string): Promise<void> {
|
||||
return promise;
|
||||
}
|
||||
|
||||
export async function loadTemplates(url: string): Promise<string> {
|
||||
export async function loadFile(url: string): Promise<string> {
|
||||
const result = await fetch(url);
|
||||
if (!result.ok) {
|
||||
throw new Error("Error while fetching xml templates");
|
||||
|
||||
Reference in New Issue
Block a user