8 second timeout on the show screen
This commit is contained in:
+11
-1
@@ -32,7 +32,7 @@
|
|||||||
</dl>
|
</dl>
|
||||||
{% if flower.dateCreated not in ('STORED', 'FAILED') %}
|
{% if flower.dateCreated not in ('STORED', 'FAILED') %}
|
||||||
<div class="detail-actions">
|
<div class="detail-actions">
|
||||||
<form action="{{ url_for('flower_vase.application') }}" method="post">
|
<form id="edit-form" action="{{ url_for('flower_vase.application') }}" method="post">
|
||||||
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
||||||
<input type="hidden" name="action" value="edit">
|
<input type="hidden" name="action" value="edit">
|
||||||
<input type="hidden" name="organization" value="{{ flower.organization }}">
|
<input type="hidden" name="organization" value="{{ flower.organization }}">
|
||||||
@@ -46,7 +46,17 @@
|
|||||||
const secret = document.querySelector('#secret');
|
const secret = document.querySelector('#secret');
|
||||||
const reveal = document.querySelector('#reveal');
|
const reveal = document.querySelector('#reveal');
|
||||||
const copy = document.querySelector('#copy');
|
const copy = document.querySelector('#copy');
|
||||||
|
const editForm = document.querySelector('#edit-form');
|
||||||
let visible = false;
|
let visible = false;
|
||||||
|
|
||||||
|
const returnToList = window.setTimeout(() => {
|
||||||
|
window.location.assign('{{ url_for("flower_vase.application") }}');
|
||||||
|
}, 8000);
|
||||||
|
|
||||||
|
if (editForm) {
|
||||||
|
editForm.addEventListener('submit', () => window.clearTimeout(returnToList));
|
||||||
|
}
|
||||||
|
|
||||||
reveal.addEventListener('click', () => {
|
reveal.addEventListener('click', () => {
|
||||||
visible = !visible;
|
visible = !visible;
|
||||||
secret.textContent = visible ? secret.dataset.secret : '••••••••••••';
|
secret.textContent = visible ? secret.dataset.secret : '••••••••••••';
|
||||||
|
|||||||
Reference in New Issue
Block a user