* Fix #1108 Hide email input on signup page so that it doesn't hide part of the bottom of the page * Fix #1115 Prevent clicking on the button more than once in a row. * Show the email input on desktop
This commit is contained in:
parent
41eaa668a1
commit
16224b3c02
|
@ -1,12 +1,11 @@
|
||||||
/* global LIMITS */
|
/* global LIMITS */
|
||||||
const html = require('choo/html');
|
const html = require('choo/html');
|
||||||
const { bytes } = require('../utils');
|
const { bytes, platform } = require('../utils');
|
||||||
|
|
||||||
module.exports = function() {
|
module.exports = function() {
|
||||||
return function(state, emit, close) {
|
return function(state, emit, close) {
|
||||||
setTimeout(function() {
|
const hidden = platform() === 'android' ? 'hidden' : '';
|
||||||
document.getElementById('email-input').focus();
|
let submitting = false;
|
||||||
});
|
|
||||||
return html`
|
return html`
|
||||||
<send-signup-dialog class="flex flex-col p-4">
|
<send-signup-dialog class="flex flex-col p-4">
|
||||||
<p class="p-8">
|
<p class="p-8">
|
||||||
|
@ -25,7 +24,7 @@ module.exports = function() {
|
||||||
<input
|
<input
|
||||||
id="email-input"
|
id="email-input"
|
||||||
type="text"
|
type="text"
|
||||||
class="border rounded w-full px-2 py-1 h-12 mb-4 text-lg text-grey-darker leading-loose"
|
class="${hidden} border rounded w-full px-2 py-1 h-12 mb-4 text-lg text-grey-darker leading-loose"
|
||||||
placeholder=${state.translate('emailEntryPlaceholder')} />
|
placeholder=${state.translate('emailEntryPlaceholder')} />
|
||||||
<input
|
<input
|
||||||
class="hidden"
|
class="hidden"
|
||||||
|
@ -53,6 +52,11 @@ module.exports = function() {
|
||||||
|
|
||||||
function submitEmail(event) {
|
function submitEmail(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
if (submitting) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
submitting = true;
|
||||||
|
|
||||||
const el = document.getElementById('email-input');
|
const el = document.getElementById('email-input');
|
||||||
const email = el.value;
|
const email = el.value;
|
||||||
emit('login', emailish(email) ? email : null);
|
emit('login', emailish(email) ? email : null);
|
||||||
|
|
Loading…
Reference in New Issue