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

There is a bug when click outside #176

Open
yuzhigang opened this issue Dec 1, 2017 · 0 comments
Open

There is a bug when click outside #176

yuzhigang opened this issue Dec 1, 2017 · 0 comments

Comments

@yuzhigang
Copy link

yuzhigang commented Dec 1, 2017

the page slide can't be closed when I click outside once. I have to click twice.

       function onBodyClick(e) {
            var target = e.touches && e.touches[0] || e.target;
            if (
              isOpen &&
              body.contains(target) &&
              !slider.contains(target)
            ) {
              isOpen = false;
              scope.psOpen = false;
              scope.$apply();
            }

when function onBodyClick() is called, isOpen is false, so the page slide can‘t be closed.
so, in function psOpen(), we need to insert code after scope.psOpen = true;
isOpen = true;
I change it, it works.

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

No branches or pull requests

1 participant