Skip to content
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

File drop propagation #317

Closed
danialfarid opened this issue Sep 5, 2014 · 1 comment
Closed

File drop propagation #317

danialfarid opened this issue Sep 5, 2014 · 1 comment

Comments

@danialfarid
Copy link
Owner

#294

@ghost
Copy link

ghost commented Sep 13, 2014

It can be useful to allow the drop event to propagate.
For example, I have a project where I show some drop boxes at different places on the page when the user drag a file over the window.

Here is my code :

angular.module('core')

    .factory('windowDragOverService', function ($rootScope, $document) {

        var dragover = 0;
        $rootScope.windowDragOver = false;

        $document
            .on('dragenter', function () {
                dragover++;
                $rootScope.windowDragOver = dragover > 0;
                $rootScope.$digest();
            })
            .on('dragleave drop', function () {
                dragover--;
                $rootScope.windowDragOver = dragover > 0;
                $rootScope.$digest();
            });

        return null;
    });

I need to know when there's a drop to hide those boxes.

danialfarid pushed a commit that referenced this issue Sep 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant