Skip to content

Commit

Permalink
Fix disappearing label for persona email input (Closes #42)
Browse files Browse the repository at this point in the history
  • Loading branch information
Galaxy102 committed Feb 13, 2022
1 parent 4321a74 commit 234761d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
5 changes: 5 additions & 0 deletions src/main/resources/static/css/toolkit.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
.nav-pills .nav-link:not(.active):hover {
background-color: #6c757d;
}

.form-floating-group input {
border-bottom-right-radius: 0;
border-top-right-radius: 0;
}
2 changes: 1 addition & 1 deletion src/main/resources/static/js/toolkit.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function triggerComponentSelect(element) {
// Inspired by https://thecoderain.blogspot.com/2020/11/generate-valid-random-email-js-jquery.html
const emailChars = '1234567890';
function generateEmailAddress(btnEl) {
const target = $(btnEl).parent().children().first();
const target = $(btnEl).parent().children().first().children().first();
var mail = 'mail';
for (let i = 0; i < 10; i++) {
mail += emailChars[Math.floor(Math.random() * emailChars.length)];
Expand Down
8 changes: 5 additions & 3 deletions src/main/resources/templates/bootstrap/datasim/persona.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ <h3 class="mb-3">Add new Persona</h3>
</div>
</div>
<div class="col-5">
<div class="mb-3 mt-3 form-floating input-group">
<input type="email" class="form-control" minlength="3" maxlength="255" name="mbox" id="newPersonaMbox" placeholder="pseudo" required>
<label for="newPersonaMbox">Persona Mail (without prefixes)</label>
<div class="mb-3 mt-3 input-group">
<div class="form-floating form-floating-group flex-grow-1">
<input type="email" class="form-control" minlength="3" maxlength="255" name="mbox" id="newPersonaMbox" placeholder="pseudo" required>
<label for="newPersonaMbox">Persona Mail (without prefixes)</label>
</div>
<button class="btn btn-outline-secondary no-spinner" type="button" onclick="generateEmailAddress(this);"><i class="bi-arrow-repeat"></i></button>
</div>
</div>
Expand Down

0 comments on commit 234761d

Please sign in to comment.