Skip to content

Commit

Permalink
Add dotted border hint when dragging over a file
Browse files Browse the repository at this point in the history
  • Loading branch information
niclimcy authored and luk1337 committed Dec 26, 2023
1 parent 03910d3 commit e6a32be
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/components/verify-main/VerifyTabPage.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<template>
<div class="tab-page verify-tab-page" ondragover="event.preventDefault()" v-on:drop="fileDropped">
<div
class="tab-page verify-tab-page"
v-on:dragover="fileDragOver"
v-on:dragleave="fileDragLeave"
v-on:drop="fileDropped"
>
<a href="#" class="verify-icon" v-on:click="verifyClicked">Verify OTA package signature</a>
<form ref="form">
<input type="file" ref="input" style="display: none;" />
Expand All @@ -17,8 +22,16 @@ export default {
input.onchange = () => this.verifyFile(input.files[0]);
},
methods: {
fileDragOver(event) {
event.preventDefault();
event.currentTarget.classList.add('dragover-border');
},
fileDragLeave(event) {
event.currentTarget.classList.remove('dragover-border');
},
fileDropped(event) {
event.preventDefault();
event.currentTarget.classList.remove('dragover-border');
this.verifyFile(event.dataTransfer.files[0]);
},
verifyClicked() {
Expand Down Expand Up @@ -79,4 +92,8 @@ export default {
background: #167c80 !important;
}
}
.dragover-border {
border: 2px dashed #167c80;
}
</style>

0 comments on commit e6a32be

Please sign in to comment.