parent
0839bcd327
commit
06c0a9b34c
|
|
@ -159,10 +159,13 @@ export class ItemBrowserDialog extends HandlebarsApplicationMixin(ApplicationV2)
|
|||
context.items = this._items
|
||||
?.filter(p => p.name.toLowerCase().indexOf(context.filterName.toLowerCase()) !== -1 || context.filterName === "")
|
||||
?.filter(p => p.category.indexOf(context.filterCategory) !== -1 || context.filterCategory === "")
|
||||
?.filter(p => Number(context.filter_price_lower) <= p.price && p.price <= Number(context.filter_price_upper))
|
||||
?.filter(p => Number(context.filter_weight_lower) <= p.weight && p.weight <= Number(context.filter_weight_upper))
|
||||
|
||||
|
||||
if (context.filter_price_lower !== context.filter_price_upper) {
|
||||
context.items = context.items?.filter(p => Number(context.filter_price_lower) <= p.price && p.price <= Number(context.filter_price_upper))
|
||||
}
|
||||
if (context.filter_price_lower !== context.filter_price_upper) {
|
||||
context.items = context.items?.filter(p => Number(context.filter_weight_lower) <= p.weight && p.weight <= Number(context.filter_weight_upper))
|
||||
}
|
||||
|
||||
return context
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue