btcpayserver/BTCPayServer/wwwroot/pos/cart.js
d11n 9b5c8a8254
POS: Add item list to keypad (#5814)
* Add admin option to show item list for keypad view

* Refactor common POS Vue mixin

* Add item list to POS keypad

* Add recent transactions to cart

* Keypad: Pass tip and discount as cart does

* Keypad and cart tests

* Improve offcanvas button

---------

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>
2024-03-14 11:11:54 +01:00

30 lines
756 B
JavaScript

document.addEventListener("DOMContentLoaded",function () {
new Vue({
el: '#PosCart',
mixins: [posCommon],
data () {
return {
$cart: null,
amount: 0,
persistState: true
}
},
watch: {
cart: {
handler(newCart) {
if (!newCart || newCart.length === 0) {
this.$cart.hide()
}
}
}
},
methods: {
toggleCart() {
this.$cart.toggle()
}
},
mounted() {
this.$cart = new bootstrap.Offcanvas(this.$refs.cart, { backdrop: false })
}
});
});