[IMP] web: ConfirmationDialog can take a confirmClass props
Before this commit, the confirm button of the confirmation dialog was always btn-primary. After this commit, it can take a props to modify that. Part-of: odoo/odoo#126963
This commit is contained in:
@@ -68,12 +68,14 @@ ConfirmationDialog.props = {
|
||||
body: String,
|
||||
confirm: { type: Function, optional: true },
|
||||
confirmLabel: { type: String, optional: true },
|
||||
confirmClass: { type: String, optional: true },
|
||||
cancel: { type: Function, optional: true },
|
||||
cancelLabel: { type: String, optional: true },
|
||||
};
|
||||
ConfirmationDialog.defaultProps = {
|
||||
confirmLabel: _lt("Ok"),
|
||||
cancelLabel: _lt("Cancel"),
|
||||
confirmClass: "btn-primary",
|
||||
title: _lt("Confirmation"),
|
||||
};
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<Dialog size="'md'" title="props.title" modalRef="modalRef">
|
||||
<p t-out="props.body" class="text-prewrap"/>
|
||||
<t t-set-slot="footer" owl="1">
|
||||
<button class="btn btn-primary" t-on-click="_confirm" t-esc="props.confirmLabel"/>
|
||||
<button class="btn" t-att-class="props.confirmClass" t-on-click="_confirm" t-esc="props.confirmLabel"/>
|
||||
<button t-if="props.cancel" class="btn btn-secondary" t-on-click="_cancel" t-esc="props.cancelLabel"/>
|
||||
</t>
|
||||
</Dialog>
|
||||
@@ -15,7 +15,7 @@
|
||||
<Dialog size="'sm'" title="props.title" contentClass="props.contentClass">
|
||||
<p t-out="props.body" class="text-prewrap"/>
|
||||
<t t-set-slot="footer" owl="1">
|
||||
<button class="btn btn-primary" t-on-click="_confirm" t-esc="props.confirmLabel"/>
|
||||
<button class="btn" t-att-class="props.confirmClass" t-on-click="_confirm" t-esc="props.confirmLabel"/>
|
||||
<button t-if="props.cancel" class="btn btn-secondary" t-on-click="_cancel" t-esc="props.cancelLabel"/>
|
||||
</t>
|
||||
</Dialog>
|
||||
|
||||
Reference in New Issue
Block a user