Small code layout improvements.
This commit is contained in:
parent
003fb346e6
commit
382db2a5c2
1 changed files with 11 additions and 11 deletions
|
@ -69,20 +69,20 @@
|
||||||
dropContainer = manager.dropContainer,
|
dropContainer = manager.dropContainer,
|
||||||
inputField = manager.inputField,
|
inputField = manager.inputField,
|
||||||
inCounter = 0,
|
inCounter = 0,
|
||||||
cancelEvent = function (e) {
|
overEvent = function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault()
|
||||||
e.stopPropagation();
|
e.stopPropagation()
|
||||||
inCounter++
|
inCounter++
|
||||||
//console.log('in', inCounter, dropContainer)
|
//console.log('in', inCounter, dropContainer)
|
||||||
showDropZone(dropContainer)
|
showDropZone(dropContainer)
|
||||||
};
|
};
|
||||||
stopEvent = function (e) {
|
stopEvent = function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault()
|
||||||
e.stopPropagation();
|
e.stopPropagation()
|
||||||
};
|
};
|
||||||
leaveEvent = function (e) {
|
leaveEvent = function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault()
|
||||||
e.stopPropagation();
|
e.stopPropagation()
|
||||||
inCounter--
|
inCounter--
|
||||||
//console.log('out', inCounter)
|
//console.log('out', inCounter)
|
||||||
if ( inCounter == 0 ) {
|
if ( inCounter == 0 ) {
|
||||||
|
@ -101,14 +101,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dropContainer) {
|
if (dropContainer) {
|
||||||
manager.on(dropContainer, 'dragleave', leaveEvent);
|
manager.on(dropContainer, 'dragleave', leaveEvent)
|
||||||
manager.on(dropContainer, 'dragover', stopEvent);
|
manager.on(dropContainer, 'dragover', stopEvent)
|
||||||
manager.on(dropContainer, 'dragenter', cancelEvent);
|
manager.on(dropContainer, 'dragenter', overEvent)
|
||||||
manager.on(dropContainer, 'drop', function (e) {
|
manager.on(dropContainer, 'drop', function (e) {
|
||||||
inCounter = 0
|
inCounter = 0
|
||||||
stopEvent(e);
|
stopEvent(e);
|
||||||
hideDropZone(dropContainer)
|
hideDropZone(dropContainer)
|
||||||
manager.processFiles(e.dataTransfer.files);
|
manager.processFiles(e.dataTransfer.files)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue