diff --git a/build/jquery.steps.js b/build/jquery.steps.js index 956b05a..6cd1b49 100644 --- a/build/jquery.steps.js +++ b/build/jquery.steps.js @@ -1,6 +1,6 @@ /*! - * jQuery Steps v1.1.0 - 09/04/2014 - * Copyright (c) 2014 Rafael Staib (http://www.jquery-steps.com) + * jQuery Steps v1.1.0 - 04/09/2015 + * Copyright (c) 2015 Rafael Staib (http://www.jquery-steps.com) * Licensed under MIT http://www.opensource.org/licenses/MIT */ ;(function ($, undefined) @@ -233,7 +233,7 @@ function destroy(wizard, options) // Remove virtual data objects from the wizard wizard.unbind(eventNamespace).removeData("uid").removeData("options") .removeData("state").removeData("steps").removeData("eventNamespace") - .find(".actions a").unbind(eventNamespace); + .find("." + options.actionsCssClass + " a").unbind(eventNamespace); // Remove attributes and CSS classes from the wizard wizard.removeClass(options.clearFixCssClass + " vertical"); @@ -273,11 +273,12 @@ function destroy(wizard, options) * @private * @method finishStep * @param wizard {Object} The jQuery wizard object + * @param options {Object} Settings of the current wizard * @param state {Object} The state container of the current wizard **/ -function finishStep(wizard, state) +function finishStep(wizard, options, state) { - var currentStep = wizard.find(".steps li").eq(state.currentIndex); + var currentStep = getStepsCollection(wizard, options).children("li").eq(state.currentIndex); if (wizard.triggerHandler("finishing", [state.currentIndex])) { @@ -348,6 +349,26 @@ function getSteps(wizard) return wizard.data("steps"); } +function getStepsCollection(wizard, options) +{ + return wizard.find('.' + options.stepsCssClass + ' > ul'); +} + +function getContentContainer(wizard, options) +{ + return wizard.find('.' + options.contentCssClass); +} + +function getHeaderCollection(wizard, options) +{ + return wizard.find('.' + options.contentCssClass + ' > ' + '.' + options.headerCssClass); +} + +function getBodyCollection(wizard, options) +{ + return wizard.find('.' + options.contentCssClass + ' > ' + '.' + options.bodyCssClass); +} + /** * Gets a specific step object by index. * @@ -517,7 +538,7 @@ function goToStep(wizard, options, state, index) } else { - wizard.find(".steps li").eq(oldIndex).addClass("error"); + getStepsCollection(wizard, options).children("li").eq(oldIndex).addClass("error"); } return true; @@ -609,7 +630,7 @@ function insertStep(wizard, options, state, index, step) } state.stepCount++; - var contentContainer = wizard.find(".content"), + var contentContainer = getContentContainer(wizard, options), header = $("<{0}>{1}".format(options.headerTag, step.title)), body = $("<{0}>".format(options.bodyTag)); @@ -627,7 +648,7 @@ function insertStep(wizard, options, state, index, step) getStepPanel(wizard, (index - 1)).after(body).after(header); } - renderBody(wizard, state, body, index); + renderBody(wizard, options, state, body, index); renderTitle(wizard, options, state, header, index); refreshSteps(wizard, options, state, index); if (index === state.currentIndex) @@ -709,7 +730,7 @@ function loadAsyncContent(wizard, options, state) switch (getValidEnumValue(contentMode, currentStep.contentMode)) { case contentMode.iframe: - wizard.find(".content > .body").eq(state.currentIndex).empty() + getBodyCollection(wizard, options).eq(state.currentIndex).empty() .html("