Always show IPA table button in pronunciation fields
This commit is contained in:
parent
87b7bbff89
commit
9743e934d3
|
@ -268,18 +268,16 @@ export function renderEditForm(wordId = false) {
|
||||||
wordId = typeof wordId.target === 'undefined' ? wordId : parseInt(this.id.replace('edit_', ''));
|
wordId = typeof wordId.target === 'undefined' ? wordId : parseInt(this.id.replace('edit_', ''));
|
||||||
const word = window.currentDictionary.words.find(w => w.wordId === wordId);
|
const word = window.currentDictionary.words.find(w => w.wordId === wordId);
|
||||||
if (word) {
|
if (word) {
|
||||||
const ipaPronunciationField = `<label>Pronunciation<a class="label-button ipa-table-button">IPA Chart</a><br>
|
const ipaPronunciationField = `<input id="wordPronunciation_${wordId}" class="ipa-field" maxlength="200" value="${word.pronunciation}"><br>
|
||||||
<input id="wordPronunciation_${wordId}" class="ipa-field" maxlength="200" value="${word.pronunciation}"><br>
|
<a class="label-help-button ipa-field-help-button">Field Help</a>`;
|
||||||
<a class="label-help-button ipa-field-help-button">Field Help</a>
|
const plainPronunciationField = `<input id="wordPronunciation_${wordId}" maxlength="200" value="${word.pronunciation}">`;
|
||||||
</label>`;
|
|
||||||
const plainPronunciationField = `<label>Pronunciation<br>
|
|
||||||
<input id="wordPronunciation_${wordId}" maxlength="200" value="${word.pronunciation}">
|
|
||||||
</label>`;
|
|
||||||
const editForm = `<form id="editForm_${wordId}" class="edit-form">
|
const editForm = `<form id="editForm_${wordId}" class="edit-form">
|
||||||
<label>Word<span class="red">*</span><br>
|
<label>Word<span class="red">*</span><br>
|
||||||
<input id="wordName_${wordId}" maxlength="200" value="${word.name}">
|
<input id="wordName_${wordId}" maxlength="200" value="${word.name}">
|
||||||
</label>
|
</label>
|
||||||
|
<label>Pronunciation<a class="label-button ipa-table-button">IPA Chart</a><br>
|
||||||
${window.settings.useIPAPronunciationField ? ipaPronunciationField : plainPronunciationField}
|
${window.settings.useIPAPronunciationField ? ipaPronunciationField : plainPronunciationField}
|
||||||
|
</label>
|
||||||
<label>Part of Speech<br>
|
<label>Part of Speech<br>
|
||||||
<select id="wordPartOfSpeech_${wordId}" class="part-of-speech-select">
|
<select id="wordPartOfSpeech_${wordId}" class="part-of-speech-select">
|
||||||
<option value="${word.partOfSpeech}" selected>${word.partOfSpeech}</option>
|
<option value="${word.partOfSpeech}" selected>${word.partOfSpeech}</option>
|
||||||
|
|
|
@ -68,7 +68,7 @@ export function toggleHotkeysEnabled() {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function toggleIPAPronunciationFields(render = true) {
|
export function toggleIPAPronunciationFields(render = true) {
|
||||||
const ipaButtons = document.querySelectorAll('.ipa-table-button, .ipa-field-help-button'),
|
const ipaButtons = document.querySelectorAll('.ipa-field-help-button'),
|
||||||
ipaFields = document.querySelectorAll('.ipa-field');
|
ipaFields = document.querySelectorAll('.ipa-field');
|
||||||
if (!window.settings.useIPAPronunciationField) {
|
if (!window.settings.useIPAPronunciationField) {
|
||||||
Array.from(ipaButtons).forEach(button => {
|
Array.from(ipaButtons).forEach(button => {
|
||||||
|
|
Loading…
Reference in New Issue