Skip to content

Commit 2b12f2c

Browse files
committed
got example code loading working
1 parent 286cb1e commit 2b12f2c

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

‎v5-unity/js/opt-frontend.js‎

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -623,23 +623,18 @@ $(document).ready(function() {
623623
lang = 'cpp';
624624
} else if (PY2_EXAMPLES[myId] !== undefined) {
625625
exFile = PY2_EXAMPLES[myId];
626-
627-
// only switch Python mode to 2 if we're not on '2' or '3'; otherwise
628-
// leave as-is so as not to rock the boat
629-
if ($('#pythonVersionSelector').val() !== '2' &&
630-
$('#pythonVersionSelector').val() !== '3') {
626+
if ($('#pythonVersionSelector').val() === '3') {
627+
lang = '3';
628+
} else {
631629
lang = '2';
632630
}
633631
} else {
634632
exFile = PY3_EXAMPLES[myId];
635633
assert(exFile !== undefined);
636634
lang = '3';
637635
}
638-
639-
640-
if (lang) {
641-
$('#pythonVersionSelector').val(lang);
642-
}
636+
assert(lang);
637+
$('#pythonVersionSelector').val(lang);
643638

644639
if (lang === '2' || lang === '3') {
645640
exFile = 'example-code/python/' + exFile;

0 commit comments

Comments
 (0)