Skip to content
Merged
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
Prev Previous commit
Next Next commit
Comply with es-lint
  • Loading branch information
diogoscf committed Dec 10, 2019
commit e8b180ab4b20d057aecaa7e5d8c69250097b20b5
13 changes: 7 additions & 6 deletions assets/js/translator.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var PUNCTUATION_KEY_CODES = [46, 33, 58, 63, 47, 45, 190, 171, 49]; // eslint-di

/* global config, modeEnabled, synchronizeTextareaHeights, persistChoices, getLangByCode, sendEvent, onlyUnique, restoreChoices
getDynamicLocalization, locale, ajaxSend, ajaxComplete, localizeInterface, filterLangList, cache, readCache, iso639Codes,
callApy, apyRequestTimeout, isURL, removeSoftHyphens, parentLang, isVariant */
callApy, apyRequestTimeout, isURL, removeSoftHyphens, parentLang, isVariant, langDirection */
/* global ENTER_KEY_CODE, HTTP_BAD_REQUEST_CODE, HTTP_OK_CODE, SPACE_KEY_CODE, XHR_DONE, XHR_LOADING */

if(modeEnabled('translation')) {
Expand Down Expand Up @@ -557,15 +557,16 @@ function populateTranslationList() {
var maxSrcLangsWidth, maxDstLangsWidth;

// figure out how much space is actually available for the columns
if(langDirection(locale) == 'ltr') {
if(langDirection(locale) === 'ltr') {
maxSrcLangsWidth = $(window).width() - $('#srcLanguagesDropdownTrigger').offset().left - TRANSLATION_LISTS_BUFFER;
maxDstLangsWidth = $('#dstLanguagesDropdownTrigger').offset().left + $('#dstLanguagesDropdownTrigger').outerWidth() -
TRANSLATION_LISTS_BUFFER;
} else {
maxSrcLangsWidth = $('#srcLanguagesDropdownTrigger').offset().left + $('#srcLanguagesDropdownTrigger').outerWidth() -
}
else {
maxSrcLangsWidth = $('#srcLanguagesDropdownTrigger').offset().left + $('#srcLanguagesDropdownTrigger').outerWidth() -
TRANSLATION_LISTS_BUFFER;
maxDstLangsWidth = $(window).width() - $('#dstLanguagesDropdownTrigger').offset().left - TRANSLATION_LISTS_BUFFER;
};
maxDstLangsWidth = $(window).width() - $('#dstLanguagesDropdownTrigger').offset().left - TRANSLATION_LISTS_BUFFER;
}

// then, prevent all the columns from getting too wide
maxSrcLangsWidth = Math.min(TRANSLATION_LIST_MAX_WIDTH, maxSrcLangsWidth);
Expand Down