Skip to content

Commit 36fdc6b

Browse files
committed
making help button into anchor
1 parent d1457a8 commit 36fdc6b

3 files changed

Lines changed: 20 additions & 13 deletions

File tree

wiktionary_pron/css/style.css

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,16 @@ body i.icon-moon {
222222
#help_button {
223223
color: black;
224224
padding: 3px 15px 5px 15px;
225+
}
226+
227+
#help_button_link {
228+
display: inline-block;
229+
margin-left: 10px;
230+
text-decoration: none;
225231
position: absolute;
226-
display: none;
232+
227233
}
234+
228235
#header {
229236
display: flex;
230237
flex-direction: row;

wiktionary_pron/index.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,10 @@ <h1 style="flex: 1;">Online IPA Converter</h1>
6060

6161

6262
</select>
63-
<button id="help_button" type="button" title="Help for selected language" style="margin-left: 10px;">?
64-
</button>
63+
<a id="help_button_link" href="#" target="_blank" rel="noopener noreferrer"
64+
style="display: none; margin-left: 10px; text-decoration: none;">
65+
<button id="help_button" type="button" title="Help for selected language">?</button>
66+
</a>
6567
<p id="loading_text"></p>
6668
</div>
6769
<div>

wiktionary_pron/scripts/main.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -617,18 +617,16 @@ async function updateOptionsUponLanguageSelection(event) {
617617
console.log("changing language to ", selectedLanguage);
618618

619619
// Update help button
620-
const helpButton = document.getElementById("help_button");
621-
if (helpButton) {
620+
const helpButtonLink = document.getElementById("help_button_link");
621+
if (helpButtonLink) {
622622
if (selectedLanguage && selectedLanguage !== "-- select an option --") {
623-
helpButton.style.display = "inline-block";
624-
helpButton.onclick = () => {
625-
const helpUrl = `help/${selectedLanguage
626-
.toLowerCase()
627-
.replace(/\s+/g, "_")}.html`;
628-
window.open(helpUrl, "_blank");
629-
};
623+
const helpUrl = `help/${selectedLanguage
624+
.toLowerCase()
625+
.replace(/\s+/g, "_")}.html`;
626+
helpButtonLink.style.display = "inline-block";
627+
helpButtonLink.href = helpUrl;
630628
} else {
631-
helpButton.style.display = "none";
629+
helpButtonLink.style.display = "none";
632630
}
633631
}
634632

0 commit comments

Comments
 (0)