Skip to content

Commit c5da28a

Browse files
authored
Metadata editor / add visual indication when dragging a file to upload (#8678)
1 parent a7c6f2d commit c5da28a

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

web-ui/src/main/resources/catalog/components/filestore/FileStoreDirective.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,18 @@
7171
input.attr("multiple", "multiple");
7272
}
7373

74+
var droparea = $(".file-drop-area");
75+
76+
// highlight drag area
77+
input.on("dragenter focus click", function () {
78+
droparea.addClass("is-active");
79+
});
80+
81+
// back to normal state
82+
input.on("dragleave blur drop", function () {
83+
droparea.removeClass("is-active");
84+
});
85+
7486
var uploadFile = function () {
7587
scope.queue = [];
7688
scope.filestoreUploadOptions = angular.extend(

web-ui/src/main/resources/catalog/components/filestore/partials/dataUploaderButton.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div
2-
class="form-horizontal"
2+
class="form-horizontal file-drop-area"
33
data-ng-show="uuid"
44
id="gn-upload-{{id}}"
55
data-file-upload="filestoreUploadOptions"

web-ui/src/main/resources/catalog/style/gn_editor.less

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,3 +1030,12 @@ gn-bounding-polygon {
10301030
opacity: 0.65;
10311031
}
10321032
}
1033+
1034+
.file-drop-area {
1035+
padding: 10px;
1036+
}
1037+
1038+
.is-active {
1039+
background-color: #e2edf7;
1040+
border-radius: 3px;
1041+
}

0 commit comments

Comments
 (0)