Skip to content

Commit

Permalink
Update to v1.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
kid1194 committed Dec 23, 2022
1 parent d6a4dd2 commit 901316c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion frappe_better_list_view/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# Licence: Please refer to LICENSE file


__version__ = "1.3.2"
__version__ = "1.3.3"
8 changes: 3 additions & 5 deletions frappe_better_list_view/public/js/better_list_view.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = $('<div>').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;
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -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 = $('<div>').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;
}
};

0 comments on commit 901316c

Please sign in to comment.