fix: Grid Form buttons Insert Above, Insert Below not hidden when can… (backport #12906) (#12907)

Co-authored-by: shariquerik <sharique.rik@gmail.com>
This commit is contained in:
mergify[bot] 2021-04-19 17:20:54 +05:30 committed by GitHub
parent 6587744b09
commit 3b5b908d8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -555,6 +555,15 @@ export default class GridRow {
this.grid_form.render();
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')
.addClass('hidden');
} else {
this.wrapper.find('.grid-insert-row-below, .grid-insert-row, .grid-duplicate-row')
.removeClass('hidden');
}
frappe.dom.freeze("", "dark");
if (cur_frm) cur_frm.cur_grid = this;
this.wrapper.addClass("grid-row-open");