Skip to content

Commit

Permalink
Click anywhere to trigger file selection
Browse files Browse the repository at this point in the history
  • Loading branch information
aliok committed Oct 3, 2023
1 parent 76e20b0 commit 92b12a4
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion services/ui-service/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@
</head>
<body>

<!-- invisible file input-->
<input type="file" id="imageSelectInput" name="image" accept="image/*" capture="environment">

<div id="container">
<div id="homeView">
<div></div>
Expand All @@ -216,7 +219,6 @@
<div class="buttons">
<div class="imageSelectButton" class="btn btn-outline-light btn-lg">
<img class="touchImg" src="static/touch_button.svg"/>
<input type="file" id="imageSelectInput" name="image" accept="image/*">
</div>
</div>
<div class="bottomTitle">
Expand Down Expand Up @@ -407,6 +409,13 @@ <h1 class="modal-title fs-5 text-danger" id="errorModalLabel">Error</h1>
console.log("Disconnected from reply service!");
});

$("#homeView").on("click", function (e) {
console.log("Opening file selection");
$('#imageSelectInput').focus().trigger('click');
e.preventDefault();
return false;
});

function callUpload() {
$.ajax({
url: UPLOAD_SERVICE_URL,
Expand Down

0 comments on commit 92b12a4

Please sign in to comment.