mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[REF] qweb: small cleanup
This commit is contained in:
+4
-4
@@ -759,7 +759,7 @@ const setDirective: Directive = {
|
|||||||
const ifDirective: Directive = {
|
const ifDirective: Directive = {
|
||||||
name: "if",
|
name: "if",
|
||||||
priority: 20,
|
priority: 20,
|
||||||
atNodeEncounter({ node, qweb, ctx }): boolean {
|
atNodeEncounter({ node, ctx }): boolean {
|
||||||
let cond = ctx.getValue(node.getAttribute("t-if")!);
|
let cond = ctx.getValue(node.getAttribute("t-if")!);
|
||||||
ctx.addIf(`${ctx.formatExpression(cond)}`);
|
ctx.addIf(`${ctx.formatExpression(cond)}`);
|
||||||
return false;
|
return false;
|
||||||
@@ -772,7 +772,7 @@ const ifDirective: Directive = {
|
|||||||
const elifDirective: Directive = {
|
const elifDirective: Directive = {
|
||||||
name: "elif",
|
name: "elif",
|
||||||
priority: 30,
|
priority: 30,
|
||||||
atNodeEncounter({ node, qweb, ctx }): boolean {
|
atNodeEncounter({ node, ctx }): boolean {
|
||||||
let cond = ctx.getValue(node.getAttribute("t-elif")!);
|
let cond = ctx.getValue(node.getAttribute("t-elif")!);
|
||||||
ctx.addLine(`else if (${ctx.formatExpression(cond)}) {`);
|
ctx.addLine(`else if (${ctx.formatExpression(cond)}) {`);
|
||||||
ctx.indent();
|
ctx.indent();
|
||||||
@@ -868,7 +868,7 @@ const forEachDirective: Directive = {
|
|||||||
const onDirective: Directive = {
|
const onDirective: Directive = {
|
||||||
name: "on",
|
name: "on",
|
||||||
priority: 90,
|
priority: 90,
|
||||||
atNodeCreation({ ctx, fullName, value, nodeID, qweb }) {
|
atNodeCreation({ ctx, fullName, value, nodeID }) {
|
||||||
ctx.rootContext.shouldDefineOwner = true;
|
ctx.rootContext.shouldDefineOwner = true;
|
||||||
const eventName = fullName.slice(5);
|
const eventName = fullName.slice(5);
|
||||||
let extraArgs;
|
let extraArgs;
|
||||||
@@ -913,7 +913,7 @@ const refDirective: Directive = {
|
|||||||
const widgetDirective: Directive = {
|
const widgetDirective: Directive = {
|
||||||
name: "widget",
|
name: "widget",
|
||||||
priority: 100,
|
priority: 100,
|
||||||
atNodeEncounter({ ctx, value, node, qweb }): boolean {
|
atNodeEncounter({ ctx, value, node }): boolean {
|
||||||
ctx.addLine("//WIDGET");
|
ctx.addLine("//WIDGET");
|
||||||
ctx.rootContext.shouldDefineOwner = true;
|
ctx.rootContext.shouldDefineOwner = true;
|
||||||
let props = node.getAttribute("t-props");
|
let props = node.getAttribute("t-props");
|
||||||
|
|||||||
Reference in New Issue
Block a user