updated download password input style
This commit is contained in:
parent
130ddca135
commit
ebecc6bb81
@ -11,8 +11,12 @@
|
|||||||
padding: 10px 0;
|
padding: 10px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.red {
|
.error {
|
||||||
color: red;
|
color: var(--errorColor);
|
||||||
|
}
|
||||||
|
|
||||||
|
.input--error {
|
||||||
|
border-color: var(--errorColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-device-width: 520px), (max-width: 520px) {
|
@media (max-device-width: 520px), (max-width: 520px) {
|
||||||
|
@ -2,22 +2,25 @@ const html = require('choo/html');
|
|||||||
|
|
||||||
module.exports = function(state, emit) {
|
module.exports = function(state, emit) {
|
||||||
const fileInfo = state.fileInfo;
|
const fileInfo = state.fileInfo;
|
||||||
const label =
|
const invalid = fileInfo.password === null;
|
||||||
fileInfo.password === null
|
const label = invalid
|
||||||
? html`
|
? html`
|
||||||
<label class="red" for="password-input">
|
<label class="error" for="password-input">
|
||||||
${state.translate('passwordTryAgain')}
|
${state.translate('passwordTryAgain')}
|
||||||
</label>`
|
</label>`
|
||||||
: html`
|
: html`
|
||||||
<label for="password-input">
|
<label for="password-input">
|
||||||
${state.translate('unlockInputLabel')}
|
${state.translate('unlockInputLabel')}
|
||||||
</label>`;
|
</label>`;
|
||||||
|
const inputClass = invalid
|
||||||
|
? 'input input--noBtn input--error'
|
||||||
|
: 'input input--noBtn';
|
||||||
const div = html`
|
const div = html`
|
||||||
<div class="passwordSection">
|
<div class="passwordSection">
|
||||||
${label}
|
${label}
|
||||||
<form class="passwordForm" onsubmit=${checkPassword} data-no-csrf>
|
<form class="passwordForm" onsubmit=${checkPassword} data-no-csrf>
|
||||||
<input id="password-input"
|
<input id="password-input"
|
||||||
class="input input--noBtn"
|
class="${inputClass}"
|
||||||
maxlength="64"
|
maxlength="64"
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
placeholder="${state.translate('unlockInputPlaceholder')}"
|
placeholder="${state.translate('unlockInputPlaceholder')}"
|
||||||
@ -37,6 +40,7 @@ module.exports = function(state, emit) {
|
|||||||
function inputChanged() {
|
function inputChanged() {
|
||||||
const input = document.getElementById('password-input');
|
const input = document.getElementById('password-input');
|
||||||
const btn = document.getElementById('password-btn');
|
const btn = document.getElementById('password-btn');
|
||||||
|
input.classList.remove('input--error');
|
||||||
if (input.value.length > 0) {
|
if (input.value.length > 0) {
|
||||||
btn.classList.remove('inputBtn--hidden');
|
btn.classList.remove('inputBtn--hidden');
|
||||||
input.classList.remove('input--noBtn');
|
input.classList.remove('input--noBtn');
|
||||||
|
Loading…
Reference in New Issue
Block a user