fix: 🐛 Fix pulsanti fab

This commit is contained in:
Maicol Battistini 2023-06-06 18:31:47 +02:00
parent 21a33275fe
commit ec95b28e31
No known key found for this signature in database
1 changed files with 13 additions and 10 deletions

View File

@ -120,11 +120,9 @@ export default abstract class RecordsPage<
<>
<h2>{this.title}</h2>
{this.table()}
{this.recordDialogType && !this.readonlyRecords && (
<div className="sticky-bottom" style={{display: 'flex', flexDirection: 'column', gap: '16px'}}>
{this.fab().values().all()}
</div>
)}
<div className="sticky-bottom" style={{display: 'flex', flexDirection: 'column', gap: '16px'}}>
{this.fab().values().all()}
</div>
<>
{...this.recordDialogs().values<Children>().all()}
{...this.deleteRecordDialogs().values<Children>().all()}
@ -134,18 +132,23 @@ export default abstract class RecordsPage<
}
fab(): Collection<Vnode> {
return collect({
const fabs = collect<Vnode>({
refresh: (
<md-fab id="refresh-records" ariaLabel={__('Aggiorna')} onclick={this.onRefreshRecordsButtonClicked.bind(this)}>
<MdIcon icon={mdiRefresh} slot="icon"/>
</md-fab>
),
add: (
)
});
if ((this.recordDialogType || this.recordPageRouteName) && !this.readonlyRecords) {
fabs.put(
'add',
<md-fab id="add-record" ariaLabel={__('Aggiungi')} onclick={this.onAddNewRecordButtonClicked.bind(this)}>
<MdIcon icon={mdiPlus} slot="icon"/>
</md-fab>
)
});
);
}
return fabs;
}
table(): Children {