[hub] Item page skeleton
This commit is contained in:
parent
dd8045759f
commit
f6f429fb10
@ -204,6 +204,10 @@ class SubPage {
|
||||
this.hide();
|
||||
}
|
||||
|
||||
empty() {
|
||||
this.$wrapper.empty();
|
||||
}
|
||||
|
||||
show() {
|
||||
this.refresh();
|
||||
this.$wrapper.show();
|
||||
@ -325,6 +329,7 @@ erpnext.hub.SearchPage = class SearchPage extends SubPage {
|
||||
|
||||
erpnext.hub.Item = class Item extends SubPage {
|
||||
refresh() {
|
||||
this.show_skeleton();
|
||||
this.hub_item_code = frappe.get_route()[2];
|
||||
|
||||
this.get_item(this.hub_item_code)
|
||||
@ -334,6 +339,30 @@ erpnext.hub.Item = class Item extends SubPage {
|
||||
});
|
||||
}
|
||||
|
||||
show_skeleton() {
|
||||
const skeleton = `<div class="hub-item-container">
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="hub-item-skeleton-image"></div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h2 class="hub-skeleton" style="width: 75%;">Name</h2>
|
||||
<div class="text-muted">
|
||||
<p class="hub-skeleton" style="width: 35%;">Details</p>
|
||||
<p class="hub-skeleton" style="width: 50%;">Ratings</p>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="hub-item-description">
|
||||
<p class="hub-skeleton">Desc</p>
|
||||
<p class="hub-skeleton" style="width: 85%;">Desc</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
this.$wrapper.html(skeleton);
|
||||
}
|
||||
|
||||
get_item(hub_item_code) {
|
||||
return hub.call('get_item_details', { hub_item_code });
|
||||
}
|
||||
|
@ -139,6 +139,20 @@ body[data-route^="marketplace/"] {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.hub-item-skeleton-image {
|
||||
border-radius: 4px;
|
||||
background-color: @light-bg;
|
||||
overflow: hidden;
|
||||
height: 200px;
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.hub-skeleton {
|
||||
background-color: @light-bg;
|
||||
color: @light-bg;
|
||||
max-width: 500px;
|
||||
}
|
||||
|
||||
.hub-item-seller img {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
|
Loading…
x
Reference in New Issue
Block a user