Skip to content

Commit

Permalink
Merge pull request WebGoat#480 from matthias-g/fixPageNum
Browse files Browse the repository at this point in the history
Fix next page button when url doesn't end with page number
  • Loading branch information
misfir3 authored Jun 7, 2018
2 parents c510bd9 + 89f6a73 commit 0030c7b
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ define(['jquery',
}
this.set('content',content);
this.set('lessonUrl',document.URL.replace(/\.lesson.*/,'.lesson'));
this.set('pageNum',document.URL.replace(/.*\.lesson\/(\d{1,4})$/,'$1'));
if (/.*\.lesson\/(\d{1,4})$/.test(document.URL)) {
this.set('pageNum',document.URL.replace(/.*\.lesson\/(\d{1,4})$/,'$1'));
} else {
this.set('pageNum',0);
}
this.trigger('content:loaded',this,loadHelps);
},

Expand Down

0 comments on commit 0030c7b

Please sign in to comment.