Skip to content

Commit

Permalink
[FIX] spreadsheet_oca: Error when deleting a worksheet
Browse files Browse the repository at this point in the history
Closes #32
  • Loading branch information
chrisandrewmann committed May 31, 2024
1 parent 6bf589a commit 3a649d8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,13 @@
onClosed.bind="closeDialog"
t-if="state.dialogDisplayed"
>
<input type="text" class="form-control" t-model="state.dialogContent" />
<span t-if="state.dialogHideInputBox" t-esc="state.dialogContent" />
<input
t-else=""
type="text"
class="form-control"
t-model="state.dialogContent"
/>
<t t-set-slot="buttons">
<button
class="btn btn-primary"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export class SpreadsheetRenderer extends Component {
useSubEnv({
saveSpreadsheet: this.onSpreadsheetSaved.bind(this),
editText: this.editText.bind(this),
askConfirmation: this.askConfirmation.bind(this),
});
onWillStart(async () => {
await loadSpreadsheetDependencies();
Expand All @@ -105,6 +106,7 @@ export class SpreadsheetRenderer extends Component {
this.state.dialogDisplayed = false;
this.state.dialogTitle = "Spreadsheet";
this.state.dialogContent = undefined;
this.state.dialogHideInputBox = false;
}
onSpreadsheetSaved() {
const data = this.spreadsheet_model.exportData();
Expand All @@ -120,6 +122,15 @@ export class SpreadsheetRenderer extends Component {
this.closeDialog();
};
}
askConfirmation(content, confirm) {
this.state.dialogContent = content;
this.state.dialogDisplayed = true;
this.state.dialogHideInputBox = true;
this.confirmDialog = () => {
confirm();
this.closeDialog();
};
}
}

SpreadsheetRenderer.template = "spreadsheet_oca.SpreadsheetRenderer";
Expand Down

0 comments on commit 3a649d8

Please sign in to comment.