impress / impress.js

It's a presentation framework based on the power of CSS3 transforms and transitions in modern browsers and inspired by the idea behind prezi.com.
http://impress.js.org
MIT License
37.65k stars 6.66k forks source link

Use title instead of id in navigation select #802

Closed hugocvx closed 2 years ago

hugocvx commented 2 years ago

Hi there,

Since i use generated ID for my slides, I had to modify goto select generation to get title instead of using ID.

 var selectOptionsHtml = function() {
        var options = '';
        for ( var i = 0; i < steps.length; i++ ) {

            // Omit steps that are listed as hidden from select widget
            if ( hideSteps.indexOf( steps[ i ] ) < 0 ) {
                options = options + '<option value="' + steps[ i ].id + '">' + // jshint ignore:line
                    (steps[ i ].title ? steps[ i ].title : steps[ i ].id ) + '</option>' + '\n'; // jshint ignore:line
            }
        }
        return options;
    };

If there is no title, it keeps on using ID.

Can be nice to have this added in future.

henrikingo commented 2 years ago

Thanks. This is a nice improvement. Would you like to submit a PR?

hugocvx commented 2 years ago

done (sooo long and hard to do it (I am not a github fluent user, prefer svn))

henrikingo commented 2 years ago

I agree :-D Came to git from bzr myself. Give it 10 years or so, you'll get used to it.

henrikingo commented 2 years ago

Thanks for doing it though, this way the commit has your name on it! Welcome to the club of impress.js contributors!

hugocvx commented 2 years ago

In 10 years, something else will have pop up I hope :)

For info, I start integrating lightly impress in my Arboos (kind of object arborescent database). Lightly because I just take a sample and adapt it to my immediate need up to now, but will go deeper later.

Nice work with impress by the way.