From a69154b5c99f28504009d7215867c9016c41662e Mon Sep 17 00:00:00 2001 From: ninadsp Date: Fri, 6 Aug 2010 19:23:17 +0530 Subject: [PATCH] Removed the appendInlineAnchor call from ajaxSuccess event as it was also fired at a successful inline edit query. Instead, created a custom event appendAnchor on #sqlqueryresults which is triggered when necessary. Also got transformations working for application/octetstream mime type. --- js/sql.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/js/sql.js b/js/sql.js index eeac2f48d..96d2395c2 100644 --- a/js/sql.js +++ b/js/sql.js @@ -86,12 +86,12 @@ $(document).ready(function() { disp_mode = $(this).val(); }) - appendInlineAnchor(disp_mode); - - $("#sqlqueryresults").ajaxSuccess(function() { + $("#sqlqueryresults").live('appendAnchor',function() { appendInlineAnchor(disp_mode); }) + $("#sqlqueryresults").trigger('appendAnchor'); + $('') .html(PMA_messages['strToggleQueryBox']) .appendTo("#sqlqueryform"); @@ -117,8 +117,9 @@ $(document).ready(function() { } else { $("#sqlqueryresults").html(data); + $("#sqlqueryresults").trigger('appendAnchor'); if($("#togglequerybox").siblings(":visible").length > 0) { - $("#togglequerybox").trigger('click'); + $("#togglequerybox").trigger('click'); } } }) @@ -134,6 +135,7 @@ $(document).ready(function() { $.post($(the_form).attr('action'), $(the_form).serialize(), function(data) { $("#sqlqueryresults").html(data); + $("#sqlqueryresults").trigger('appendAnchor'); }) })// end Paginate results table @@ -145,6 +147,7 @@ $(document).ready(function() { $.get($(this).attr('href'), $(this).serialize() + '&ajax_request=true', function(data) { $("#sqlqueryresults").html(data); + $("#sqlqueryresults").trigger('appendAnchor'); }) })// end Paginate results with Page Selector @@ -156,6 +159,7 @@ $(document).ready(function() { $.get($(this).attr('href'), $(this).serialize() + '&ajax_request=true', function(data) { $("#sqlqueryresults").html(data); + $("#sqlqueryresults").trigger('appendAnchor'); }) })//end Sort results table @@ -165,6 +169,7 @@ $(document).ready(function() { $.post($(this).attr('action'), $(this).serialize() + '&ajax_request=true' , function(data) { $("#sqlqueryresults").html(data); + $("#sqlqueryresults").trigger('appendAnchor'); }) }) //end displayOptionsForm handler @@ -374,7 +379,7 @@ $(document).ready(function() { $.each(data.transformations, function(key, value) { if(key == field_name) { - if($(this_field).hasClass('text_plain')) { + if($(this_field).is('.text_plain, .application_octetstream')) { new_html = value; return false; }