fix: POS Item Cart non-stop scroll issue (#26693)
This commit is contained in:
parent
a75c7c48d8
commit
4597f151f5
@ -564,7 +564,6 @@ erpnext.PointOfSale.ItemCart = class {
|
|||||||
)
|
)
|
||||||
|
|
||||||
set_dynamic_rate_header_width();
|
set_dynamic_rate_header_width();
|
||||||
this.scroll_to_item($item_to_update);
|
|
||||||
|
|
||||||
function set_dynamic_rate_header_width() {
|
function set_dynamic_rate_header_width() {
|
||||||
const rate_cols = Array.from(me.$cart_items_wrapper.find(".item-rate-amount"));
|
const rate_cols = Array.from(me.$cart_items_wrapper.find(".item-rate-amount"));
|
||||||
@ -639,12 +638,6 @@ erpnext.PointOfSale.ItemCart = class {
|
|||||||
$($img).parent().replaceWith(`<div class="item-image item-abbr">${item_abbr}</div>`);
|
$($img).parent().replaceWith(`<div class="item-image item-abbr">${item_abbr}</div>`);
|
||||||
}
|
}
|
||||||
|
|
||||||
scroll_to_item($item) {
|
|
||||||
if ($item.length === 0) return;
|
|
||||||
const scrollTop = $item.offset().top - this.$cart_items_wrapper.offset().top + this.$cart_items_wrapper.scrollTop();
|
|
||||||
this.$cart_items_wrapper.animate({ scrollTop });
|
|
||||||
}
|
|
||||||
|
|
||||||
update_selector_value_in_cart_item(selector, value, item) {
|
update_selector_value_in_cart_item(selector, value, item) {
|
||||||
const $item_to_update = this.get_cart_item(item);
|
const $item_to_update = this.get_cart_item(item);
|
||||||
$item_to_update.attr(`data-${selector}`, escape(value));
|
$item_to_update.attr(`data-${selector}`, escape(value));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user