attachPoint: 'after'
}, stepConfig);
+ if (stepConfig.attachTo) {
+ stepConfig.attachTo = $(stepConfig.attachTo).first();
+ }
+
return stepConfig;
};
this.positionBackdrop(stepConfig);
if (stepConfig.attachPoint === 'append') {
- $(stepConfig.attachTo).append(currentStepNode);
+ stepConfig.attachTo.append(currentStepNode);
this.currentStepNode = currentStepNode;
} else {
- this.currentStepNode = currentStepNode.insertAfter($(stepConfig.attachTo));
+ this.currentStepNode = currentStepNode.insertAfter(stepConfig.attachTo);
}
// Ensure that the step node is positioned.
stepConfig.isOrphan = true;
// This will be appended to the body instead.
- stepConfig.attachTo = 'body';
+ stepConfig.attachTo = $('body').first();
stepConfig.attachPoint = 'append';
// Add the backdrop.
currentStepNode.addClass('orphan');
// It lives in the body.
- $(stepConfig.attachTo).append(currentStepNode);
+ stepConfig.attachTo.append(currentStepNode);
this.currentStepNode = currentStepNode;
this.currentStepNode.offset(this.calculateStepPositionInPage());
if (stepConfig.zIndex) {
if (stepConfig.attachPoint === 'append') {
- $(stepConfig.attachTo).append(backdrop);
+ stepConfig.attachTo.append(backdrop);
} else {
- backdrop.insertAfter($(stepConfig.attachTo));
+ backdrop.insertAfter(stepConfig.attachTo);
}
} else {
$('body').append(backdrop);
if (stepConfig.zIndex) {
if (stepConfig.attachPoint === 'append') {
- $(stepConfig.attachTo).append(background);
+ stepConfig.attachTo.append(background);
} else {
- fader.insertAfter($(stepConfig.attachTo));
- background.insertAfter($(stepConfig.attachTo));
+ fader.insertAfter(stepConfig.attachTo);
+ background.insertAfter(stepConfig.attachTo);
}
} else {
$('body').append(fader);