Skip to content
This repository was archived by the owner on Feb 12, 2022. It is now read-only.

Commit b81349d

Browse files
Merge pull request #1880 from cormacmccarthy/master
cleans up code from recent PR #1879
2 parents 5b4ba95 + 96af82e commit b81349d

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

js/wizard.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@
3232
// WIZARD CONSTRUCTOR AND PROTOTYPE
3333

3434
var Wizard = function (element, options) {
35-
var kids, steps;
36-
3735
this.$element = $(element);
3836
this.options = $.extend({}, $.fn.wizard.defaults, options);
3937
this.options.disablePreviousStep = (this.$element.attr('data-restrict') === 'previous') ? true : this.options.disablePreviousStep;
@@ -42,7 +40,11 @@
4240
this.$prevBtn = this.$element.find('button.btn-prev');
4341
this.$nextBtn = this.$element.find('button.btn-next');
4442

45-
steps = this.$element.children('.steps-container');
43+
var kids = this.$nextBtn.children().detach();
44+
this.nextText = $.trim(this.$nextBtn.text());
45+
this.$nextBtn.append(kids);
46+
47+
var steps = this.$element.children('.steps-container');
4648
// maintains backwards compatibility with < 3.8, will be removed in the future
4749
if (steps.length === 0) {
4850
steps = this.$element;
@@ -53,10 +55,6 @@
5355
}
5456
steps = steps.find('.steps');
5557

56-
kids = this.$nextBtn.children().detach();
57-
this.nextText = $.trim(this.$nextBtn.text());
58-
this.$nextBtn.append(kids);
59-
6058
// handle events
6159
this.$prevBtn.on('click.fu.wizard', $.proxy(this.previous, this));
6260
this.$nextBtn.on('click.fu.wizard', $.proxy(this.next, this));

0 commit comments

Comments
 (0)