perf: avoid layout thrashing in grid setup_toolbar (#37265)
This commit is contained in:
parent
ffe362316d
commit
d3f090edac
1 changed files with 5 additions and 4 deletions
|
|
@ -593,8 +593,9 @@ export default class Grid {
|
|||
}
|
||||
|
||||
setup_toolbar() {
|
||||
if (this.is_editable()) {
|
||||
this.wrapper.find(".grid-footer").toggle(true);
|
||||
const is_editable = this.is_editable();
|
||||
if (is_editable) {
|
||||
this.wrapper.find(".grid-footer").removeClass("hidden");
|
||||
|
||||
const num_selected_rows = this.get_selected_children().length;
|
||||
// show, hide buttons to add rows
|
||||
|
|
@ -619,12 +620,12 @@ export default class Grid {
|
|||
this.grid_rows.length < this.grid_pagination.page_length &&
|
||||
!this.df.allow_bulk_edit
|
||||
) {
|
||||
this.wrapper.find(".grid-footer").toggle(false);
|
||||
this.wrapper.find(".grid-footer").addClass("hidden");
|
||||
}
|
||||
|
||||
this.wrapper
|
||||
.find(".grid-add-row, .grid-add-multiple-rows, .grid-upload")
|
||||
.toggle(this.is_editable());
|
||||
.toggleClass("hidden", !is_editable);
|
||||
}
|
||||
|
||||
truncate_rows() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue