Highlight dropzone when dragging
This commit is contained in:
parent
e3dbbd1b11
commit
c339a8c770
@ -1,4 +1,25 @@
|
|||||||
Dropzone.options.dropzone = {
|
Dropzone.options.dropzone = {
|
||||||
|
init: function() {
|
||||||
|
this.dzone = document.getElementById("dzone");
|
||||||
|
this.on("drop", function(ev) {
|
||||||
|
this.dzone.style.backgroundColor = "#FAFBFC";
|
||||||
|
});
|
||||||
|
this.on("dragstart", function(ev) {
|
||||||
|
this.dzone.style.backgroundColor = "#2c89f0";
|
||||||
|
});
|
||||||
|
this.on("dragend", function(ev) {
|
||||||
|
this.dzone.style.backgroundColor = "#FAFBFC";
|
||||||
|
});
|
||||||
|
this.on("dragenter", function(ev) {
|
||||||
|
this.dzone.style.backgroundColor = "#2c89f0";
|
||||||
|
});
|
||||||
|
this.on("dragover", function(ev) {
|
||||||
|
this.dzone.style.backgroundColor = "#2c89f0";
|
||||||
|
});
|
||||||
|
this.on("dragleave", function(ev) {
|
||||||
|
this.dzone.style.backgroundColor = "#FAFBFC";
|
||||||
|
});
|
||||||
|
},
|
||||||
addedfile: function(file) {
|
addedfile: function(file) {
|
||||||
var upload = document.createElement("div");
|
var upload = document.createElement("div");
|
||||||
upload.className = "upload";
|
upload.className = "upload";
|
||||||
@ -69,6 +90,7 @@ Dropzone.options.dropzone = {
|
|||||||
}
|
}
|
||||||
file.leftElement.style.color = "#E68181";
|
file.leftElement.style.color = "#E68181";
|
||||||
},
|
},
|
||||||
|
|
||||||
maxFilesize: 4096,
|
maxFilesize: 4096,
|
||||||
previewsContainer: "#uploads",
|
previewsContainer: "#uploads",
|
||||||
parallelUploads: 5,
|
parallelUploads: 5,
|
||||||
|
@ -12,11 +12,10 @@
|
|||||||
<input type="submit" value="Upload">
|
<input type="submit" value="Upload">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="dz-default dz-message">
|
<div id="dzone" class="dz-default dz-message">
|
||||||
<span>Click or Drop file(s)</span>
|
<span>Click or Drop file(s)</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div id="choices">
|
<div id="choices">
|
||||||
<div id="expiry">
|
<div id="expiry">
|
||||||
<label>File expiry:
|
<label>File expiry:
|
||||||
|
Loading…
Reference in New Issue
Block a user