Skip to content

Commit eb6d0f8

Browse files
author
Rafael J. Staib
committed
Change Number to parseInt
1 parent 3449c49 commit eb6d0f8

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

jquery.steps.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -988,10 +988,11 @@
988988
if (options.saveState && $.cookie)
989989
{
990990
var savedState = $.cookie(_cookiePrefix + getUniqueId(wizard));
991-
// Sets the saved position to the start index if not undefined or out of range set
992-
if (savedState != null && Number(savedState) < state.stepCount)
991+
// Sets the saved position to the start index if not undefined or out of range
992+
var savedIndex = parseInt(savedState, 0);
993+
if (!isNaN(savedIndex) && savedIndex < state.stepCount)
993994
{
994-
startIndex = Number(savedState);
995+
startIndex = savedIndex;
995996
}
996997
}
997998

@@ -1312,7 +1313,7 @@
13121313
content = header.next(".body"),
13131314
mode = (content.data("mode") == null) ? $.fn.steps.contentMode.html :
13141315
getValidEnumValue($.fn.steps.contentMode, (/^\s*$/.test(content.data("mode")) || isNaN(content.data("mode"))) ?
1315-
content.data("mode") : Number(content.data("mode"))),
1316+
content.data("mode") : parseInt(content.data("mode"), 0)),
13161317
contentUrl = (mode === $.fn.steps.contentMode.html || content.data("url") === undefined) ?
13171318
"" : content.data("url"),
13181319
contentLoaded = (mode !== $.fn.steps.contentMode.html && content.data("loaded") === "1");
@@ -1429,7 +1430,7 @@
14291430
*/
14301431
function getStepPosition(anchor)
14311432
{
1432-
return Number(anchor.attr("href").substring(anchor.attr("href").lastIndexOf("-") + 1));
1433+
return parseInt(anchor.attr("href").substring(anchor.attr("href").lastIndexOf("-") + 1), 0);
14331434
}
14341435

14351436
/**

0 commit comments

Comments
 (0)