hakimel/reveal.js — pull request #721 by hakimel (2013-11-26 00:53:22+00:00)
Title: Refactor fragments

Multiple issues related to fragments have popped up lately (#613, #683, #697, #709). Appreciate the pull requests that have been submitted to patch those issues but I think the current fragment implementation was getting too... fragmented. So I felt like it was time to rewrite it, this includes:

- A new `navigateFragments` method which does what the `slide()`, `nextFragment()` and `previousFragment()` methods used to have their own logic for. Fixes #613
- A `current-fragment` class for #704
- Zero-based indices to match how slides work
- Normalization of fragment indices to make sure there are no gaps. For example, the explicit `data-fragment-index` values 2, 4 and 6 would be rewritten to 0, 1 and 2. Fixes #683
- This happens for all fragments when reveal.js is initialized
- Additional fragment tests