From b935093a80a4568f578433a5cfabe9c0fa16905f Mon Sep 17 00:00:00 2001 From: Sander Hollaar Date: Mon, 31 Oct 2022 13:55:00 +0100 Subject: [PATCH 1/4] Fix: Hide Back button on first page as window.close() does not work on Firefox (and match backButton.attr() with irma_sms_issuer) --- webapp/common.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webapp/common.js b/webapp/common.js index bcb759c..70ba538 100644 --- a/webapp/common.js +++ b/webapp/common.js @@ -35,13 +35,15 @@ function setWindow(window, back) { } const backButton = $('#back-button'); backButton.off(); + backButton.hide(); if (back) { + backButton.show(); backButton .click(() => {clearStatus(); setWindow(back); return false;}) .removeAttr('href') .removeClass('button-hidden'); } else { - backButton.attr('href', MESSAGES['issuers-overview-page']); + backButton.attr('href', 'javascript:history.length==1?window.close():history.back()'); if (isInApp) backButton.addClass('button-hidden'); } From 5cc9a8de41e89b62ab2e7467ab6bbb7d5cf1cc67 Mon Sep 17 00:00:00 2001 From: Sander Hollaar Date: Mon, 31 Oct 2022 15:08:57 +0100 Subject: [PATCH 2/4] hide back button when there is nothing to go back to --- webapp/common.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/webapp/common.js b/webapp/common.js index 70ba538..f99fc1b 100644 --- a/webapp/common.js +++ b/webapp/common.js @@ -35,17 +35,13 @@ function setWindow(window, back) { } const backButton = $('#back-button'); backButton.off(); - backButton.hide(); if (back) { - backButton.show(); backButton .click(() => {clearStatus(); setWindow(back); return false;}) .removeAttr('href') .removeClass('button-hidden'); - } else { - backButton.attr('href', 'javascript:history.length==1?window.close():history.back()'); - if (isInApp) - backButton.addClass('button-hidden'); + } else if (history.length == 1) { + backButton.addClass('button-hidden'); } const submitButtonText = MESSAGES['submit-' + window]; @@ -53,9 +49,9 @@ function setWindow(window, back) { if (submitButtonText) { submitButton.text(submitButtonText); submitButton.removeClass('hidden'); - } - else + } else { submitButton.addClass('hidden'); + } } function addEmail(e) { From b47dcbfdfa185ee84e8fd341b1cdb39b623cc2cd Mon Sep 17 00:00:00 2001 From: Sander Hollaar Date: Wed, 2 Nov 2022 11:33:07 +0100 Subject: [PATCH 3/4] remove href from back-button --- webapp/en/index.html | 2 +- webapp/nl/index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/webapp/en/index.html b/webapp/en/index.html index 27f155f..0ffc0ae 100644 --- a/webapp/en/index.html +++ b/webapp/en/index.html @@ -62,7 +62,7 @@

Adding an e-mail address