From 7c5d45a454ce97603a3aa0a7c09f00e0d00792fe Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 3 Nov 2020 09:47:12 +0000 Subject: [PATCH] Bug 26938: Prevent flash of unstyled sales table On the registers page the table has come complex data structures embedded to allow for all the functionality we bring into the datatable. We should hide the table on page load and only display it at DataTables init time once the weird content has been beautified by DataTables. Test plan 1/ Enable 'UseCashRegisters' and 'EnablePointOfSale' 2/ Add a cash register and make some transactions against it. 3/ Navigate to the 'Register details' page 4/ Note that some 'funky' JSON strings appear in the table briefly before it is restyled when DataTables loads. 5/ Apply the patch 6/ Rebuild the CSS from the SCSS files 7/ Reload the page (hard reload to get the CSS changes) 8/ Note that the table now only appears once the nice formatting that DataTables adds is applied. Signed-off-by: David Nind Signed-off-by: Josef Moravec Signed-off-by: Jonathan Druart (cherry picked from commit 258d475d5f4bb306496dc90b9c602fd776a6c545) Signed-off-by: Andrew Fuerste-Henry --- koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss | 4 ++++ koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt | 3 +++ 2 files changed, 7 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss index 72daf79704..91e52d184e 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -1311,6 +1311,10 @@ div { padding: 1em; } +#sales { + display: none; +} + .tip { color: #808080; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt index 639b7de20f..eb400a19f0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt @@ -317,6 +317,9 @@ .append( ''); }, endRender: null, + }, + initComplete: function() { + $("#sales").show(); } })); -- 2.39.5