straversi / Typer.js

Typing effect completely configurable in HTML.
http://steven.codes/typerjs
MIT License
135 stars 23 forks source link

Fixing name of deleteDelay variable #2

Closed droidenator closed 7 years ago

droidenator commented 7 years ago

I was working with Typer.js and noticed that my delete delay settings had no effect. The reason is because the way the dataset element handles attribute names.

With an attribute called data-deleteDelay, it will be placed in the dataset as dataset.deletedelay.

In order to access the data as it was in your original code, you'd need the attribute to be called data-delete-delay which will be converted to camelcase and become dataset.deleteDelay.

I added a check that matches the output that would be expected based on your documentation. Alternatively you could update the documentation to reflect the data-delete-delay. This PR allows both options. I figured it'd be better to support the initial implementation for any existing users.

Thanks for the plugin!

straversi commented 7 years ago

Good catch, thank you!