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