orige-zz / jquery-bootstrap-modal-steps

A lightweight step by step modal for bootstrap
MIT License
30 stars 36 forks source link

When modal have just one step the first next button must be the complete button #3

Open orige-zz opened 9 years ago

orige-zz commented 9 years ago

See the bug on modal-sample-3 demo.

Prozexis-zz commented 7 years ago

I fixed this issue and this is work for me. Maybe you check? I added below code to $modal .on('show.bs.modal', function(){ last line before closing }

My code is:

var steps = $modal.find('div[data-step]').length;
if (parseInt(steps) === 1){
    $btnNext
        .attr('data-step', 'complete')
        .html(settings.btnLastStepHtml);
} else {
    $btnNext
        .attr('data-step', nextStep)
        .html(settings.btnNextHtml);
}