From 36a69f9e0d4cc80548116d8c54010c45bed21a32 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Thu, 24 Mar 2022 11:56:29 +0530 Subject: [PATCH] fix: Remove row highlight code from setup_sortable method --- .../custom/doctype/customize_form/customize_form.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/frappe/custom/doctype/customize_form/customize_form.js b/frappe/custom/doctype/customize_form/customize_form.js index 6471032f7f..e61620850c 100644 --- a/frappe/custom/doctype/customize_form/customize_form.js +++ b/frappe/custom/doctype/customize_form/customize_form.js @@ -50,6 +50,8 @@ frappe.ui.form.on("Customize Form", { $(grid_row.row).css({ "font-weight": "bold" }); } + grid_row.row.removeClass("highlight"); + if (grid_row.doc.is_custom_field && !grid_row.row.hasClass('highlight')) { grid_row.row.addClass("highlight"); } @@ -88,17 +90,11 @@ frappe.ui.form.on("Customize Form", { }, setup_sortable: function(frm) { - frm.page.body.find(".highlight").removeClass("highlight"); frm.doc.fields.forEach(function(f, i) { - var data_row = frm.page.body.find( - '[data-fieldname="fields"] [data-idx="' + f.idx + '"] .data-row' - ); - - if (f.is_custom_field) { - data_row.addClass("highlight"); - } else { + if (!f.is_custom_field) { f._sortable = false; } + if (f.fieldtype == "Table") { frm.add_custom_button( f.options,