Append a new anchor for inline edit to each row if javascript is supported instead of using the edit anchor for inline editing
This commit is contained in:
38
js/sql.js
38
js/sql.js
@@ -13,8 +13,8 @@ function getFieldName(this_field_obj, disp_mode) {
|
|||||||
else {
|
else {
|
||||||
var this_field_index = $(this_field_obj).index();
|
var this_field_index = $(this_field_obj).index();
|
||||||
if(window.parent.text_dir == 'ltr') {
|
if(window.parent.text_dir == 'ltr') {
|
||||||
// 3 columns to account for the checkbox, edit and delete anchors
|
// 4 columns to account for the checkbox, edit, delete and appended inline edit anchors
|
||||||
var field_name = $(this_field_obj).parents('table').find('thead').find('th:nth('+ (this_field_index-3 )+') a').text();
|
var field_name = $(this_field_obj).parents('table').find('thead').find('th:nth('+ (this_field_index-4 )+') a').text();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var field_name = $(this_field_obj).parents('table').find('thead').find('th:nth('+ this_field_index+') a').text();
|
var field_name = $(this_field_obj).parents('table').find('thead').find('th:nth('+ this_field_index+') a').text();
|
||||||
@@ -37,6 +37,40 @@ $(document).ready(function() {
|
|||||||
disp_mode = $(this).val();
|
disp_mode = $(this).val();
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if(disp_mode == 'vertical') {
|
||||||
|
var cloned_row = $('.edit_row_anchor').removeClass('edit_row_anchor').parent('tr').clone();
|
||||||
|
|
||||||
|
$(cloned_row).find('td').addClass('edit_row_anchor')
|
||||||
|
.find('a').attr('href', '#')
|
||||||
|
.find('img').attr('title', 'Inline Edit');
|
||||||
|
|
||||||
|
$(cloned_row).insertBefore($('.where_clause').parent('tr'));
|
||||||
|
|
||||||
|
$("#table_results").find('tr:first').find('th')
|
||||||
|
.attr('rowspan', '4');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$('.edit_row_anchor').each(function() {
|
||||||
|
|
||||||
|
$(this).removeClass('edit_row_anchor');
|
||||||
|
|
||||||
|
var cloned_anchor = $(this).clone();
|
||||||
|
|
||||||
|
$(cloned_anchor).addClass('edit_row_anchor')
|
||||||
|
.find('a').attr('href', '#')
|
||||||
|
.find('img').attr('title', 'Inline Edit');
|
||||||
|
|
||||||
|
$(this).siblings('.where_clause')
|
||||||
|
.before(cloned_anchor);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#rowsDeleteForm').find('thead').find('th').each(function() {
|
||||||
|
if($(this).attr('colspan') == 3) {
|
||||||
|
$(this).attr('colspan', '4')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
$('<span id="togglequerybox"></span>')
|
$('<span id="togglequerybox"></span>')
|
||||||
.html(PMA_messages['strToggleQueryBox'])
|
.html(PMA_messages['strToggleQueryBox'])
|
||||||
.appendTo("#sqlqueryform");
|
.appendTo("#sqlqueryform");
|
||||||
|
Reference in New Issue
Block a user