Skip to content

Commit 306fcfd

Browse files
committed
Ensure the inbox is opened in a new window tab
1 parent 67c181b commit 306fcfd

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

app/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ <h2>1. Sélectionnez votre département</h2>
3434
<h2>2. Choisissez votre messagerie et envoyer</h2>
3535
<p class="paragraph">un email pré-rempli est généré automatiquement. Tu peux évidemment le modifier. Si ta messagerie est différente, clique ici (lien vers le texte) pour copier le texte manuellement.</p>
3636
<div class="button-group button-group--centered button-group--attached">
37-
<button id="hk-through-gmail" class="button--small button--black hk-through-inbox">Gmail</button>
38-
<button id="hk-through-live" class="button--small button--black hk-through-inbox">Hotmail</button>
39-
<button id="hk-through-other" class="button--small hk-through-inbox">Autre</button>
37+
<a id="hk-through-gmail" href="" target="_blank" class="button button--small button--black hk-through-inbox">Gmail</a>
38+
<a id="hk-through-live" href="" target="_blank" class="button button--small button--black hk-through-inbox">Hotmail</a>
39+
<a id="hk-through-other" href="" target="_blank" class="button button--small hk-through-inbox">Autre</a>
4040
</div>
4141

4242
<h2>3. Envoi</h2>

app/scripts/scroll.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,12 @@ Merci.";
128128
targetUrl = 'mailto:' + encodeURIComponent(to) + '?' + query;
129129
}
130130

131-
window.location.href = targetUrl;
131+
el.setAttribute('href', targetUrl);
132+
133+
// simulate click
134+
var event = document.createEvent('HTMLEvents');
135+
event.initEvent('click', true, false);
136+
el.dispatchEvent(event);
132137
});
133138
});
134139
// END HACKING

0 commit comments

Comments
 (0)