fortesinformatica / Sideshow

Sideshow is a powerful javascript library which aims to reduce your user's learning curve by providing a way to create step-by-step interactive tours. Explain the features of your application, control your end-user's interaction with your UI, emphasize what you're explaining in each step by masking it. Just think! The sky is the limit!
http://fortesinformatica.github.io/Sideshow
Apache License 2.0
86 stars 31 forks source link

Unneeded error when affect returns false. #8

Open DanielApt opened 9 years ago

DanielApt commented 9 years ago

I only want to run a Wizard when the viewport is large enough. As a result my project looks something like this:

Sideshow.registerWizard({
    name: 'introGuide',
    description: 'A quick initial guide to the product',
    affects: {
        function() {
            return window.innerWidth <= 480;
        }
    }
}).storyLine([
    {...},
    {...}
    ...
]);

Sideshow.start();

This will throw an error: Uncaught SSException: [SIDESHOW_E#00000203] This wizard is not eligible neither has a preparation function.

Personally I don't think this should be an error, this is at most a warning. I don't want this wizard to run when the viewport is below 480px wide, and it's behaving exactly as I'm expecting it to.

What are your thoughts?