From 0c34e442cdfcc8eecee6d89d5b9eb7999599f429 Mon Sep 17 00:00:00 2001 From: Vincent LAURENT Date: Fri, 1 Apr 2022 15:03:50 +0200 Subject: [PATCH 1/2] Share link in sharing mode --- public/js/signature.js | 8 ++++++-- templates/signature.html.php | 5 ++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/public/js/signature.js b/public/js/signature.js index 419f61d..ca195d0 100644 --- a/public/js/signature.js +++ b/public/js/signature.js @@ -940,7 +940,9 @@ var modalSharing = function() { let modalInformations = bootstrap.Modal.getOrCreateInstance(modalInformationsEl); modalInformations.show(); modalInformationsEl.addEventListener('hidden.bs.modal', function (event) { - history.pushState({}, '', window.location.href.replace(/#.*$/, '')); + if(window.location.hash) { + history.pushState({}, '', window.location.href.replace(/#.*$/, '')); + } }) } @@ -949,7 +951,9 @@ var modalSharing = function() { let modalSigned = bootstrap.Modal.getOrCreateInstance(modalSignedEl); modalSigned.show(); modalSignedEl.addEventListener('hidden.bs.modal', function (event) { - history.pushState({}, '', window.location.href.replace(/#.*$/, '')); + if(window.location.hash) { + history.pushState({}, '', window.location.href.replace(/#.*$/, '')); + } }) } } diff --git a/templates/signature.html.php b/templates/signature.html.php index c4a3f42..e285d95 100644 --- a/templates/signature.html.php +++ b/templates/signature.html.php @@ -91,7 +91,10 @@ - Télécharger le PDF +
+ Télécharger le PDF + +
From a3d72959f79013651bb45bc91e71d5b76a7f76af Mon Sep 17 00:00:00 2001 From: Vincent LAURENT Date: Fri, 1 Apr 2022 15:09:13 +0200 Subject: [PATCH 2/2] Share link visually disabled when pdf edition is begin --- public/js/signature.js | 7 ++++++- templates/signature.html.php | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/public/js/signature.js b/public/js/signature.js index ca195d0..906e532 100644 --- a/public/js/signature.js +++ b/public/js/signature.js @@ -488,7 +488,12 @@ var createAndAddSvgInCanvas = function(canvas, item, x, y, height = null) { document.getElementById('save_mobile').removeAttribute('disabled'); } if(document.getElementById('btn_download')) { - document.getElementById('btn_download').classList.add('disabled'); + document.getElementById('btn_download').classList.remove('btn-outline-dark'); + document.getElementById('btn_download').classList.add('btn-outline-secondary'); + } + if(document.getElementById('btn_share')) { + document.getElementById('btn_share').classList.remove('btn-outline-dark'); + document.getElementById('btn_share').classList.add('btn-outline-secondary'); } diff --git a/templates/signature.html.php b/templates/signature.html.php index 1d1b2cd..65ab609 100644 --- a/templates/signature.html.php +++ b/templates/signature.html.php @@ -93,7 +93,7 @@