Skip to content

Commit d6f5bcd

Browse files
committed
Merge branch 'pasapsi-patch-1'
2 parents 10e58cf + e2203af commit d6f5bcd

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

intro.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
var allIntroSteps = [];
7777

7878
for (var i = 0, stepsLength = this._options.steps.length; i < stepsLength; i++) {
79-
var currentItem = this._options.steps[i];
79+
var currentItem = _cloneObject(this._options.steps[i]);
8080
//set the step
8181
currentItem.step = i + 1;
8282
//use querySelector function only when developer used CSS selector
@@ -206,6 +206,21 @@
206206
return false;
207207
}
208208

209+
/*
210+
* makes a copy of the object
211+
* @api private
212+
* @method _cloneObject
213+
*/
214+
function _cloneObject(object) {
215+
if (object == null || typeof (object) != 'object' || object.hasOwnProperty("nodeName") === true) {
216+
return object;
217+
}
218+
var temp = {};
219+
for (var key in object) {
220+
temp[key] = _cloneObject(object[key]);
221+
}
222+
return temp;
223+
}
209224
/**
210225
* Go to specific step of introduction
211226
*

0 commit comments

Comments
 (0)