Skip to content

Commit

Permalink
Fix for #10 and #12
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarioste committed May 3, 2018
1 parent 2a39345 commit 0e60b10
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ko.bindingHandlers.dragAndDrop = {
init: function (element, valueAccessor) {
let selectedFile = valueAccessor();
let $element = $(element);
document.addEventListener("dragenter", function( event ) {
document.addEventListener("dragenter", function (event) {
// prevent default to allow drop
event.preventDefault();
}, false);
Expand All @@ -26,13 +26,13 @@ ko.bindingHandlers.dragAndDrop = {

document.addEventListener('dragleave', function (event) {
event.preventDefault();


let $target = $(event.target);
console.log(event.target.className);
if ($target.hasClass("file-dragging")) {
$element.removeClass("file-dragging");
$("#file-drag-overlay").removeClass("file-dragging");
$("#file-drag-overlay").removeClass("file-dragging");
}
}, false);

Expand All @@ -45,16 +45,16 @@ ko.bindingHandlers.dragAndDrop = {

console.log("document. on drop");
if ($target.hasClass("file-dragging")) {
if (file && isManga) {
if (file && isManga) {
logger.debug('File is', file.path);
selectedFile(file.path);

$element.removeClass("file-dragging");
$("#file-drag-overlay").removeClass("file-dragging");
Ps.update(element);
}
}


$element.removeClass("file-dragging");
$("#file-drag-overlay").removeClass("file-dragging");
return false;
}, false)

Expand Down
1 change: 1 addition & 0 deletions app/renderer-process/scss/view-manga.scss
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
bottom: 50px;
opacity: 0;
transition: .25s;
z-index:6;
&:hover{
opacity:1;
}
Expand Down

0 comments on commit 0e60b10

Please sign in to comment.