mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-22 22:25:28 +01:00
* 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>
30 lines
756 B
JavaScript
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 })
|
|
}
|
|
});
|
|
});
|