chore: fix linting issues

This commit is contained in:
Deepesh Garg
2023-07-15 18:03:16 +05:30
parent 924cdef6d9
commit 3fa2a8c2d8
18 changed files with 42 additions and 275 deletions

View File

@@ -27,10 +27,10 @@ window.get_product_list = function() {
}
window.render_product_list = function(data) {
var table = $("#search-list .table");
let table = $("#search-list .table");
if(data.length) {
if(!table.length)
var table = $("<table class='table'>").appendTo("#search-list");
table = $("<table class='table'>").appendTo("#search-list");
$.each(data, function(i, d) {
$(d).appendTo(table);
@@ -38,11 +38,13 @@ window.render_product_list = function(data) {
}
if(data.length < 10) {
if(!table) {
let message = __("No products found.");
$(".more-btn")
.replaceWith("<div class='alert alert-warning'>{{ _("No products found.") }}</div>");
.replaceWith(`<div class='alert alert-warning'>{{ ${message} }}</div>`);
} else {
let message = __("Nothing more to show.");
$(".more-btn")
.replaceWith("<div class='text-muted'>{{ _("Nothing more to show.") }}</div>");
.replaceWith(`<div class='text-muted'>{{ ${message} }}</div>`);
}
} else {
$(".more-btn").toggle(true)

View File

@@ -72,7 +72,7 @@ frappe.ready(function() {
var more_items = function(item, item_status){
if(item_status) {
var item_status = $('.project-'+ item +'-section .btn-group .bold').hasClass('btn-completed-'+ item)
item_status = $('.project-'+ item +'-section .btn-group .bold').hasClass('btn-completed-'+ item)
? 'completed' : 'open';
}
$.ajax({