Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Differentiate between rtl and ltr for the image position #5654

Merged
merged 1 commit into from
Sep 12, 2021
Merged
Changes from all commits
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
11 changes: 5 additions & 6 deletions html/js/product-multilingual.js
Original file line number Diff line number Diff line change
@@ -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: [email protected]
// Address: 21 rue des Iles, 94100 Saint-Maur des Fossés, France
//
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -1230,4 +1229,4 @@ $("#move_images").click({},function(event) {

}

});
});