Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions assets/js/translator.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,13 @@ if(modeEnabled('translation')) {
});

$('button#translateDoc').click(function () {
$('div#translateText').fadeOut('fast', function () {
$('#fileInput').show();
$('div#fileName').hide();
$('div#docTranslation').fadeIn('fast');
$('#detect, #srcLangSelect option[value=detect]').prop('disabled', true);
});
$('#translateText > *:not(#translateOptionsContainer), #translateOptions > *:not(#markUnknownContainer')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this selector is missing a closing paren.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Felt like I closed it with the paren outside. Added :D

.fadeOut('fast', function () {
$('#fileInput').show();
$('div#fileName').hide();
$('div#docTranslation').fadeIn('fast');
$('#detect, #srcLangSelect option[value=detect]').prop('disabled', true);
});
pairs = originalPairs;
populateTranslationList();
});
Expand All @@ -233,7 +234,8 @@ if(modeEnabled('translation')) {
$('div#docTranslation').fadeOut('fast', function () {
$('a#fileDownload').hide();
$('span#uploadError').hide();
$('div#translateText').fadeIn('fast', synchronizeTextareaHeights);
$('#translateText > *:not(#translateOptionsContainer), #translateOptions > *:not(#markUnknownContainer')
.fadeIn('fast', synchronizeTextareaHeights);
$('input#fileInput').wrap('<form>').closest('form')[0].reset();
$('input#fileInput').unwrap();
$('#detect, #srcLangSelect option[value=detect]').prop('disabled', false);
Expand Down Expand Up @@ -568,7 +570,7 @@ function populateTranslationList() {
}

function translate() {
if($('div#translateText').is(':visible')) {
if($('#translateText > *:not(#translateOptionsContainer), #translateOptions > *:not(#markUnknownContainer').is(':visible')) {
translateText();
}
else if($('div#docTranslation').is(':visible')) {
Expand Down
4 changes: 2 additions & 2 deletions index.html.in
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@
<i class="fa fa-file-text"></i> <span data-text="Translate_Document">Translate a document</span>
</button>
</div>
<div class="col-lg-3 col-md-6 pull-right">
<div class="col-lg-3 col-md-6 pull-right" id="translateOptionsContainer">
<div class="checkbox" id="translateOptions">
<label class="pull-right">
<label class="pull-right" id="markUnknownContainer">
<input type="checkbox" id="markUnknown" checked>
<span data-text="Mark_Unknown_Words">Mark unknown words</span>
</label>
Expand Down