fix: encode thumbnail URL

If it contains space the URL won't load
This commit is contained in:
Ankush Menat 2022-08-31 15:38:05 +05:30 committed by Ankush Menat
parent 4a38ce659d
commit 30039e8e62

View File

@ -200,7 +200,7 @@ erpnext.ProductSearch = class {
let thumbnail = res.thumbnail || '/assets/erpnext/images/ui-states/cart-empty-state.png'; let thumbnail = res.thumbnail || '/assets/erpnext/images/ui-states/cart-empty-state.png';
html += ` html += `
<div class="dropdown-item" style="display: flex;"> <div class="dropdown-item" style="display: flex;">
<img class="item-thumb col-2" src=${thumbnail} /> <img class="item-thumb col-2" src=${encodeURI(thumbnail)} />
<div class="col-9" style="white-space: normal;"> <div class="col-9" style="white-space: normal;">
<a href="/${res.route}">${res.web_item_name}</a><br> <a href="/${res.route}">${res.web_item_name}</a><br>
<span class="brand-line">${res.brand ? "by " + res.brand : ""}</span> <span class="brand-line">${res.brand ? "by " + res.brand : ""}</span>
@ -241,4 +241,4 @@ erpnext.ProductSearch = class {
this.category_container.html(html); this.category_container.html(html);
} }
}; };