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

Add ability to define settings #5

Open
atomiks opened this issue May 31, 2017 · 4 comments
Open

Add ability to define settings #5

atomiks opened this issue May 31, 2017 · 4 comments

Comments

@atomiks
Copy link

atomiks commented May 31, 2017

Firstly, nice little library!

I'd like to define my own settings to modify the ripple. If you don't want users to use a constructor/call a factory, then perhaps use data-* attributes on the element you specify the rippleJS class name.

The main settings I'd like is

  • duration
  • ability to bind the event directly to the element. The problem with using event delegation is that sometimes you have inner elements which are the targets of the mousedown event but still want to trigger the ripple on the parent, so the ripple won't work.
@samthor
Copy link
Owner

samthor commented May 31, 2017

Thanks, glad you like it.

my 2c: data-duration sounds painful if a user has to set it on every element, but I'm loathe to have it as a global on window or something. So I'll think.

Your second ask—can you clarify, you mean you want a click on one element to trigger a ripple on another? (I can see cases where e.g., the inner thing has layout but you want an outer thing to ripple).

@atomiks
Copy link
Author

atomiks commented Jun 1, 2017

Okay, cool

<div class="outer rippleJS">
    <span>text</span>
</div>

If I click the span element, I still want the ripple to be activated since it's a child of the outer element

@cpamp
Copy link

cpamp commented Jun 27, 2017

@atomiks I don't think this is an issue. The following should give you your desired effect.

<div class="outer">
    <span>text</span>
    <div class="rippleJS"></div>
</div>

@cpamp
Copy link

cpamp commented Jun 28, 2017

@atomiks For your first issue on params, I have a fork which adds 2 attributes for color and duration. I also added additional ways to identify elements that should ripple that is less confusing and verbose

<div class="bar square" ripplejs ripplejs-color="blue" ripplejs-duration="2000ms" ripplejs-fill>
  My Content
</div>

<div class="bar square">
    <span>Clickable</span>
    <div class="rippleJS" data-ripplejs-color="red" data-ripplejs-duration="1s" data-ripplejs-fill></div>
</div>

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

3 participants