Skip to content

Simple fix for the flickering issue using a div overlaying the viewport #450

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

guinnberg
Copy link

I think this is a really simple change and fixes the issue. Please if you reckon that it could be done in a better way just let me know, since this is a feature I really would like to have in my app.

@nervgh
Copy link
Owner

nervgh commented Jul 28, 2015

Maybe, you mean

if (event.currentTarget !== self.element[0] || !self._dragingOver) return;

instead

if (event.currentTarget !== self.element[0] || !self._dragingOver) return;

?

Try

/**
 * Event handler
 */
FileDrop.prototype.onDragLeave = function(event) {
    this._dragingOver = false;
    if (event.currentTarget !== this.element[0] || !this._dragingOver) return;
    this._preventAndStop(event);
    angular.forEach(this.uploader._directives.over, this._removeOverClass, this);
};

@nervgh
Copy link
Owner

nervgh commented Jul 28, 2015

fixed #286

@nervgh nervgh closed this Jul 28, 2015
@guinnberg
Copy link
Author

I see that you merged other fix for this issue, but it has a bug that in my case wasn't happening. When you drag a file over the layer it doesn't flicker anymore (goooood!) but if you don't drop it, or drop it outside of the browser, the class is never removed.

BTW, maybe I'm blind, but I don't see the difference in what you're saying in the code lol. Anyway when _dragingOver is true, means you're draging so that's why I don't want the leave event to be fired, I'm also using the timeout trick to be sure it's not executed to soon, if it's not used, sometimes it still flickers.

What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants