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

cleans up code from recent PR #1879 #1880

Merged
merged 1 commit into from
Oct 11, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions js/wizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
// WIZARD CONSTRUCTOR AND PROTOTYPE

var Wizard = function (element, options) {
var kids, steps;

this.$element = $(element);
this.options = $.extend({}, $.fn.wizard.defaults, options);
this.options.disablePreviousStep = (this.$element.attr('data-restrict') === 'previous') ? true : this.options.disablePreviousStep;
Expand All @@ -42,7 +40,11 @@
this.$prevBtn = this.$element.find('button.btn-prev');
this.$nextBtn = this.$element.find('button.btn-next');

steps = this.$element.children('.steps-container');
var kids = this.$nextBtn.children().detach();
this.nextText = $.trim(this.$nextBtn.text());
this.$nextBtn.append(kids);

var steps = this.$element.children('.steps-container');
// maintains backwards compatibility with < 3.8, will be removed in the future
if (steps.length === 0) {
steps = this.$element;
Expand All @@ -53,10 +55,6 @@
}
steps = steps.find('.steps');

kids = this.$nextBtn.children().detach();
this.nextText = $.trim(this.$nextBtn.text());
this.$nextBtn.append(kids);

// handle events
this.$prevBtn.on('click.fu.wizard', $.proxy(this.previous, this));
this.$nextBtn.on('click.fu.wizard', $.proxy(this.next, this));
Expand Down