Skip to content
New issue

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

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

Already on GitHub? # to your account

API: Waves.ripple(element) #112

Closed
hoxxep opened this issue Apr 14, 2015 · 2 comments
Closed

API: Waves.ripple(element) #112

hoxxep opened this issue Apr 14, 2015 · 2 comments

Comments

@hoxxep
Copy link
Contributor

hoxxep commented Apr 14, 2015

Run Effect.show(e, element) on an element via an API call, and Waves.ripple(element) could mimic a click event occurring at the centre of the element, where element is a string passed to a querySelector.

Simulate mousedown and an immediate mouseup in the centre of element. I'll add this tonight, and this will simplify the mouseover/mouseleave/hover effect (requested in issue #105) as you can simply call Waves.ripple() on mouseover.

Question: Would Waves.ripple(element) check element for .waves-effect classes, or should it assume (for performance) that the necessary classes have already been set; since the user can [and should] set these through the HTML template and/or Waves.attach()?

In future, options to the function (If we used Waves.ripple(element, options)) could include setting the position of the ripple, timing etc.

@hoxxep hoxxep changed the title API/Effect Waves.ripple(element) API: Waves.ripple(element) Apr 14, 2015
@hoxxep
Copy link
Contributor Author

hoxxep commented Apr 14, 2015

Solved in pull request #113. It does not check for .waves-effect. It includes a warning in the documentation that .waves-effect should already be present on the element and could be added via Waves.attach().

Waves.calm(elements) was also added in that pull request to remove all ripples from an element. Useful when a ripple has no timeout.

@fians
Copy link
Owner

fians commented Apr 15, 2015

Merged.

@fians fians closed this as completed Apr 15, 2015
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants