Skip to content

Commit 311b651

Browse files
authored
Merge pull request #487 from limzykenneth/master
Fix download links for Chrome
2 parents 686a37f + 47476a4 commit 311b651

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/templates/pages/download/index.hbs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ slug: download/
5757
</div>
5858
</a>
5959

60-
<a class='support_link' href="http://cdnjs.com/libraries/p5.js">
60+
<a class='support_link' href="http://cdnjs.com/libraries/p5.js" target="_blank">
6161
<div class="download_box half_box last_box">
6262
<h4>CDN</h4>
6363
<p>{{#i18n "link"}}{{/i18n}}
@@ -73,7 +73,7 @@ slug: download/
7373
<div class="link_group">
7474
<a name="editor" class="anchor"><h2>{{#i18n "editor-title"}}{{/i18n}}</h2></a>
7575

76-
<a class='support_link' href="https://editor.p5js.org">
76+
<a class='support_link' href="https://editor.p5js.org" target="_blank">
7777
<div class="download_box">
7878

7979
<h4>{{#i18n "p5.js-editor"}}{{/i18n}}</h4>
@@ -124,14 +124,13 @@ slug: download/
124124
});
125125
});
126126
$('.support_link').on('click', function (e) {
127-
e.preventDefault();
128-
// if ($(this).hasClass('p5_link')) {
129-
// window.open($(this).attr('href'), '_self');
130-
// setTimeout( function() { window.location = 'support.html'; }, 2000);
131-
// } else {
132-
window.location = 'support.html';
133-
window.open($(this).attr('href'));
134-
// }
127+
if ($(this).hasClass('p5_link')) {
128+
e.preventDefault();
129+
window.location = $(this).attr('href');
130+
setTimeout( function() { window.location = 'support.html'; }, 2000);
131+
} else {
132+
setTimeout( function() { window.location = 'support.html'; }, 100);
133+
}
135134
136135
});
137136

0 commit comments

Comments
 (0)