From 4c84b64ec24004cad4deec2f704ad1d4bea6b643 Mon Sep 17 00:00:00 2001 From: hangy Date: Sat, 11 Sep 2021 23:44:56 +0200 Subject: [PATCH] fix: Differentiate between rtl and ltr for the image position --- html/js/product-multilingual.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/html/js/product-multilingual.js b/html/js/product-multilingual.js index 4b35a158e7a63..80c142a1c0475 100644 --- a/html/js/product-multilingual.js +++ b/html/js/product-multilingual.js @@ -1,7 +1,7 @@ // This file is part of Product Opener. // // Product Opener -// Copyright (C) 2011-2020 Association Open Food Facts +// Copyright (C) 2011-2021 Association Open Food Facts // Contact: contact@openfoodfacts.org // Address: 21 rue des Iles, 94100 Saint-Maur des Fossés, France // @@ -400,17 +400,16 @@ $.fn.isVisible = function() { return $.expr.filters.visible(this[0]); }; function update_nutrition_image_copy() { - // width big enough to display a copy next to nutrition table? - if ($("#nutrition_data_table").isVisible() && $('#nutrition').width() - $('#nutrition_data_table').width() > 405) { - $('#nutrition_image_copy').css("left", $('#nutrition_data_table').width() + 10).show(); + if ($("#nutrition_data_table").isVisible() && $('#nutrition').width() - $('#nutrition_data_table').width() > 405) { + var position = $('html[dir=rtl]').length ? 'right' : 'left'; + $('#nutrition_image_copy').css(position, $('#nutrition_data_table').width() + 10).show(); } else { $('#nutrition_image_copy').hide(); } } - function update_display(imagefield, first_display) { var display_url = imagefield_url[imagefield]; @@ -1230,4 +1229,4 @@ $("#move_images").click({},function(event) { } -}); \ No newline at end of file +});