From 901316c1350bb1cf665cc9cb5b97773309dff2fd Mon Sep 17 00:00:00 2001 From: kid1194 Date: Fri, 23 Dec 2022 17:15:05 +0300 Subject: [PATCH] Update to v1.3.3 --- frappe_better_list_view/__init__.py | 2 +- .../public/js/better_list_view.bundle.js | 8 +++----- .../public/js/better_list_view_v12.bundle.js | 8 +++----- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/frappe_better_list_view/__init__.py b/frappe_better_list_view/__init__.py index 6dc6138..60cabdc 100644 --- a/frappe_better_list_view/__init__.py +++ b/frappe_better_list_view/__init__.py @@ -4,4 +4,4 @@ # Licence: Please refer to LICENSE file -__version__ = "1.3.2" \ No newline at end of file +__version__ = "1.3.3" \ No newline at end of file diff --git a/frappe_better_list_view/public/js/better_list_view.bundle.js b/frappe_better_list_view/public/js/better_list_view.bundle.js index a129b31..c4a6f47 100644 --- a/frappe_better_list_view/public/js/better_list_view.bundle.js +++ b/frappe_better_list_view/public/js/better_list_view.bundle.js @@ -87,21 +87,19 @@ frappe.views.ListView = class ListView extends frappe.views.ListView { if (!$.isFunction(this.settings.set_row_background)) return html; let color = this.settings.set_row_background(doc); if (!color || Object.prototype.toString.call(color) !== '[object String]') return html; - let row = $('
').append(html), - list_row = $($(html.children()[0]).children()[0]); + let css = 'level list-row'; if ([ 'active', 'primary', 'secondary', 'success', 'danger', 'warning', 'info', ].indexOf(color) >= 0) { - list_row.addClass('table-' + color); + html = html.replace(css, css + ' table-' + color); } else if ( (color[0] === '#' && color.length >= 4) || (color.substring(0, 3).toLowerCase() === 'rgb') || (color.substring(0, 4).toLowerCase() === 'hsla') ) { - list_row.css('background-color', color); + html = html.replace(css, css + '" style="background-color:' + color); } - html = row.html(); return html; } }; \ No newline at end of file diff --git a/frappe_better_list_view/public/js/better_list_view_v12.bundle.js b/frappe_better_list_view/public/js/better_list_view_v12.bundle.js index 0b2898e..f8e60be 100644 --- a/frappe_better_list_view/public/js/better_list_view_v12.bundle.js +++ b/frappe_better_list_view/public/js/better_list_view_v12.bundle.js @@ -87,21 +87,19 @@ frappe.views.ListView = class ListView extends frappe.views.ListView { if (!$.isFunction(this.settings.set_row_background)) return html; var color = this.settings.set_row_background(doc); if (!color || Object.prototype.toString.call(color) !== '[object String]') return html; - var row = $('
').append(html), - list_row = $($(html.children()[0]).children()[0]); + var css = 'level list-row'; if ([ 'active', 'primary', 'secondary', 'success', 'danger', 'warning', 'info', ].indexOf(color) >= 0) { - list_row.addClass('table-' + color); + html = html.replace(css, css + ' table-' + color); } else if ( (color[0] === '#' && color.length >= 4) || (color.substring(0, 3).toLowerCase() === 'rgb') || (color.substring(0, 4).toLowerCase() === 'hsla') ) { - list_row.css('background-color', color); + html = html.replace(css, css + '" style="background-color:' + color); } - html = row.html(); return html; } }; \ No newline at end of file