From 756a4d71630bc970128fc3564c65601e5dfb7d9a Mon Sep 17 00:00:00 2001 From: Arc Date: Fri, 16 Jan 2026 12:41:26 +0000 Subject: [PATCH] made default hide header Because for merchants screen space is premium --- static/js/tpos.js | 26 +++++++++++++++----------- templates/tpos/_options_fab.html | 4 ++-- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/static/js/tpos.js b/static/js/tpos.js index b01f327..690df43 100644 --- a/static/js/tpos.js +++ b/static/js/tpos.js @@ -135,6 +135,8 @@ window.app = Vue.createApp({ _currencyResolver: null, _withdrawing: false, headerElement: null, + headerHidden: + this.$q.localStorage.getItem('lnbits.tpos.header') !== 'shown', categoryColors: {}, categoryColorIndex: 0, pastelColors: [ @@ -1272,14 +1274,13 @@ window.app = Vue.createApp({ }) }, headerToggle() { + this.headerHidden = !this.headerHidden + this.$q.localStorage.set( + 'lnbits.tpos.header', + this.headerHidden ? 'hidden' : 'shown' + ) if (this.headerElement) { - this.headerElement.style.display = - this.headerElement.style.display === 'none' ? '' : 'none' - if (this.headerElement.style.display === 'none') { - this.$q.localStorage.set('lnbits.tpos.header', 'hidden') - } else { - this.$q.localStorage.remove('lnbits.tpos.header') - } + this.headerElement.style.display = this.headerHidden ? 'none' : '' } } }, @@ -1327,13 +1328,16 @@ window.app = Vue.createApp({ }) this.headerElement = document.querySelector('.q-header') if (this.headerElement) { - this.headerElement.style.display = - this.$q.localStorage.getItem('lnbits.tpos.header') === 'hidden' - ? 'none' - : null + this.headerElement.style.display = this.headerHidden ? 'none' : '' } }, onMounted() { + if (!this.headerElement) { + this.headerElement = document.querySelector('.q-header') + } + if (this.headerElement) { + this.headerElement.style.display = this.headerHidden ? 'none' : '' + } setInterval(() => { this.getRates() }, 120000) diff --git a/templates/tpos/_options_fab.html b/templates/tpos/_options_fab.html index a7b6fac..0ec8459 100644 --- a/templates/tpos/_options_fab.html +++ b/templates/tpos/_options_fab.html @@ -25,10 +25,10 @@