fix: remove items with invalid image
This commit is contained in:
parent
a22aa60a17
commit
e7af44f1a6
@ -21,7 +21,7 @@ function get_item_card_html(item) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const item_html = `
|
const item_html = `
|
||||||
<div class="col-md-3 col-sm-4 col-xs-6">
|
<div class="col-md-3 col-sm-4 col-xs-6 hub-card-container">
|
||||||
<div class="hub-card"
|
<div class="hub-card"
|
||||||
data-hub-item-code="${item.hub_item_code}"
|
data-hub-item-code="${item.hub_item_code}"
|
||||||
data-route="${item.route}">
|
data-route="${item.route}">
|
||||||
@ -74,7 +74,7 @@ function get_local_item_card_html(item) {
|
|||||||
</div>`;
|
</div>`;
|
||||||
|
|
||||||
const item_html = `
|
const item_html = `
|
||||||
<div class="col-md-3 col-sm-4 col-xs-6">
|
<div class="col-md-3 col-sm-4 col-xs-6 hub-card-container">
|
||||||
<div class="hub-card is-local ${is_active ? 'active' : ''}" data-id="${id}">
|
<div class="hub-card is-local ${is_active ? 'active' : ''}" data-id="${id}">
|
||||||
<div class="hub-card-header flex">
|
<div class="hub-card-header flex">
|
||||||
<div>
|
<div>
|
||||||
|
@ -226,7 +226,14 @@ erpnext.hub.Publish = class Publish extends SubPage {
|
|||||||
|
|
||||||
items.map(item => {
|
items.map(item => {
|
||||||
this.fetched_items_dict[item.item_code] = item;
|
this.fetched_items_dict[item.item_code] = item;
|
||||||
})
|
});
|
||||||
|
|
||||||
|
// remove the items which doesn't have a valid image
|
||||||
|
setTimeout(() => {
|
||||||
|
items_container.find('.no-image').each(function() {
|
||||||
|
$(this).closest('.hub-card-container').remove();
|
||||||
|
});
|
||||||
|
}, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
get_valid_items() {
|
get_valid_items() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user