mstratman / jQuery-Smart-Wizard

flexible jQuery plug-in that gives wizard like interface
http://mstratman.github.com/jQuery-Smart-Wizard/
303 stars 164 forks source link

added buttonOrder, removed reverseButtonOrder and includeFinishButton #110

Closed soulflyman closed 7 years ago

soulflyman commented 7 years ago

Replaced reverseButtonOrder and includeFinishButton with the new option buttonOrder. ButtonOrder is a String array which can take up to 3 elements. These elements are 'finish', 'next' and 'prev'. By changing the order of the elements in the buttonOrder the Order of the buttons will change. Elements will not be displayed if removed from the list. By replacing reverseButtonOrder and includeFinishButton with buttonOrder, a better customizing and LTR integration will be possible

soulflyman commented 7 years ago

I meant LTR and RTL integration, not only LTR.

mstratman commented 7 years ago

Hey Stefan. Thanks for putting this together. Do you have any concerns about this breaking backwards compatibility for users?

soulflyman commented 7 years ago

If they are on version 3.3.1 then no. If the options are not set it falls back to the default order finish, next, prev. The only incompatibility I can recognize is for user that do not use one of the releases but use the unreleased code from the master branch. Because they could expect that the includeFinishButton and reverseButtonsOrder are still functional. But even in this case there code will not break, It won't even throw an error.

mstratman commented 7 years ago

Ultimately this project isn't being maintained, so arguably any pull is a good one.

However I wonder if it'd be worth a bit of extra code to support the old options, so that people who upgrade won't be affected. i.e. document the options as 'deprecated' with a prominent note that they will be removed.

For example, keep your new loop and switch statement which considers only buttonOrder, but then in the initialization rearrange that array if the user provided reverseButtonsOrder or includeFinishButton

What do you think?

soulflyman commented 7 years ago

I reimplemented the two options to maintain backward compatibility as you suggested.

mstratman commented 7 years ago

This is great, Thanks for the pull!