bespokejs / bespoke

DIY Presentation Micro-Framework
http://markdalgleish.com/projects/bespoke.js/
MIT License
4.68k stars 443 forks source link

Don't activate first slide if slide is already active #71

Closed mojavelinux closed 6 years ago

mojavelinux commented 6 years ago

Do not attempt to activate the first slide (slide 0) after calling the plugins if a slide is already activated. This allows a plugin, such as bespoke-hash, to activate the first slide.

Additionally, when the first slide is activated, the deactivate event should not be called since there is no slide to deactivate.

mojavelinux commented 6 years ago

One open question is what should happen if step is called by a plugin before a slide has been activated? Should the call to step be ignored? Or should it fire with a nil slide and then activate the first slide? Given that it has to step from somewhere, I think it should be ignored.

mojavelinux commented 6 years ago

As it turns out, this is actually the behavior now. It does first an event on a nil slide, but then it activates the first slide (if offset is positive).