From b71529bb72c96e755ab777b7015b985e4fb480d9 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Fri, 10 Dec 2010 13:22:48 -0500 Subject: [PATCH] bug #3125624 - fix for RTL languages --- js/sql.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/js/sql.js b/js/sql.js index 97cc42f87..e37a25869 100644 --- a/js/sql.js +++ b/js/sql.js @@ -35,16 +35,13 @@ function getFieldName($this_field, disp_mode) { } else { var this_field_index = $this_field.index(); - if(window.parent.text_dir == 'ltr') { - // 4 columns to account for the checkbox, edit, delete and appended inline edit anchors but index is zero-based so substract 3 - var field_name = $('#table_results').find('thead').find('th:nth('+ (this_field_index-3 )+') a').text(); - // happens when just one row (headings contain no a) - if ("" == field_name) { - field_name = $('#table_results').find('thead').find('th:nth('+ (this_field_index-3 )+')').text(); - } - } - else { - var field_name = $('#table_results').find('thead').find('th:nth('+ this_field_index+') a').text(); + // ltr or rtl direction does not impact how the DOM was generated + // + // 4 columns to account for the checkbox, edit, delete and appended inline edit anchors but index is zero-based so substract 3 + var field_name = $('#table_results').find('thead').find('th:nth('+ (this_field_index-3 )+') a').text(); + // happens when just one row (headings contain no a) + if ("" == field_name) { + field_name = $('#table_results').find('thead').find('th:nth('+ (this_field_index-3 )+')').text(); } }