[IMP] spreadsheet: Add class props to SpreadsheetShareButton
Make the share button style parametric as we use it in different contexts. closes odoo/odoo#139302 Task: 3329419 Related: odoo/enterprise#49302 Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
This commit is contained in:
committed by
Lucas Lefèvre (lul)
parent
d3b5ff1290
commit
b2167e0a23
@@ -19,6 +19,7 @@ export class SpreadsheetShareButton extends Component {
|
||||
static props = {
|
||||
model: { type: Model, optional: true },
|
||||
onSpreadsheetShared: Function,
|
||||
togglerClass: { type: String, optional: true },
|
||||
};
|
||||
|
||||
setup() {
|
||||
@@ -26,6 +27,10 @@ export class SpreadsheetShareButton extends Component {
|
||||
this.state = useState({ url: undefined });
|
||||
}
|
||||
|
||||
get togglerClass() {
|
||||
return ["btn btn-light", this.props.togglerClass].join(" ");
|
||||
}
|
||||
|
||||
async onOpened() {
|
||||
const model = this.props.model;
|
||||
await waitForDataLoaded(model);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<t t-name="spreadsheet.ShareButton">
|
||||
<Dropdown
|
||||
togglerClass="'btn btn-light'"
|
||||
togglerClass="togglerClass"
|
||||
menuClass="'spreadsheet_share_dropdown d-flex flex-column'"
|
||||
position="'bottom-end'"
|
||||
onOpened.bind="onOpened"
|
||||
|
||||
Reference in New Issue
Block a user