refactor: Using toggle instead of addClass-removeClass
This commit is contained in:
parent
165607565e
commit
b4fa6d56df
2 changed files with 5 additions and 8 deletions
|
|
@ -387,7 +387,7 @@ export default class Grid {
|
|||
this.wrapper.find('.grid-footer').toggle(false);
|
||||
}
|
||||
|
||||
this.wrapper.find('.grid-add-row, .grid-add-multiple-rows').toggle(this.is_editable())
|
||||
this.wrapper.find('.grid-add-row, .grid-add-multiple-rows').toggle(this.is_editable());
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -557,13 +557,10 @@ export default class GridRow {
|
|||
this.row.toggle(false);
|
||||
// this.form_panel.toggle(true);
|
||||
|
||||
if (this.grid.cannot_add_rows || (this.grid.df && this.grid.df.cannot_add_rows)) {
|
||||
this.wrapper.find('.grid-insert-row-below, .grid-insert-row, .grid-duplicate-row, .grid-append-row')
|
||||
.addClass('hidden');
|
||||
} else {
|
||||
this.wrapper.find('.grid-insert-row-below, .grid-insert-row, .grid-duplicate-row, .grid-append-row')
|
||||
.removeClass('hidden');
|
||||
}
|
||||
let cannot_add_rows = this.grid.cannot_add_rows || (this.grid.df && this.grid.df.cannot_add_rows);
|
||||
this.wrapper
|
||||
.find('.grid-insert-row-below, .grid-insert-row, .grid-duplicate-row, .grid-append-row')
|
||||
.toggle(!cannot_add_rows);
|
||||
|
||||
frappe.dom.freeze("", "dark");
|
||||
if (cur_frm) cur_frm.cur_grid = this;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue