diff --git a/js/db_operations.js b/js/db_operations.js index 4e3dedf4f..502ca0d00 100644 --- a/js/db_operations.js +++ b/js/db_operations.js @@ -60,9 +60,9 @@ $(document).ready(function() { .after(data.sql_query); //Remove the empty notice div generated due to a NULL query passed to PMA_showMessage() - var notice_class = $("#topmenucontainer").next("div").find('.notice'); - if($(notice_class).text() == '') { - $(notice_class).remove(); + var $notice_class = $("#topmenucontainer").next("div").find('.notice'); + if ($notice_class.text() == '') { + $notice_class.remove(); } $("" + PMA_messages['strReloadDatabase'] + "?").dialog({ diff --git a/js/sql.js b/js/sql.js index d9ecdea05..96483e0e7 100644 --- a/js/sql.js +++ b/js/sql.js @@ -54,10 +54,11 @@ function getFieldName($this_field, disp_mode) { * The function that iterates over each row in the table_results and appends a * new inline edit anchor to each table row. * - * @param disp_mode string */ -function appendInlineAnchor(disp_mode) { - if(disp_mode == 'vertical') { +function appendInlineAnchor() { + var disp_mode = $("#top_direction_dropdown").val(); + + if (disp_mode == 'vertical') { // there can be one or two tr containing this class, depending // on the ModifyDeleteAtLeft and ModifyDeleteAtRight cfg parameters $('#table_results tr') @@ -163,10 +164,9 @@ $(document).ready(function() { * Attach the {@link appendInlineAnchor} function to a custom event, which * will be triggered manually everytime the table of results is reloaded * @memberOf jQuery - * @name sqlqueryresults_live */ $("#sqlqueryresults").live('appendAnchor',function() { - appendInlineAnchor(disp_mode); + appendInlineAnchor(); }) /** @@ -224,7 +224,10 @@ $(document).ready(function() { $.post($(this).attr('action'), $(this).serialize() , function(data) { if(data.success == true) { - PMA_ajaxShowMessage(data.message); + // fade out previous success message, if any + $('.success').fadeOut(); + // show a message that stays on screen + $('#sqlqueryform').before(data.message); $('#sqlqueryresults').show(); // this happens if a USE command was typed if (typeof data.reload != 'undefined') { @@ -243,6 +246,7 @@ $(document).ready(function() { $('#sqlqueryresults').hide(); } else { + // real results are returned $('#sqlqueryresults').show(); $("#sqlqueryresults").html(data); $("#sqlqueryresults").trigger('appendAnchor'); @@ -270,13 +274,13 @@ $(document).ready(function() { PMA_ajaxShowMessage(); /** - * @var the_form Object referring to the form element that paginates the results table + * @var $the_form Object referring to the form element that paginates the results table */ - var the_form = $(this).parent("form"); + var $the_form = $(this).parent("form"); - $(the_form).append(''); + $the_form.append(''); - $.post($(the_form).attr('action'), $(the_form).serialize(), function(data) { + $.post($the_form.attr('action'), $the_form.serialize(), function(data) { $("#sqlqueryresults").html(data); $("#sqlqueryresults").trigger('appendAnchor'); }) // end $.post() diff --git a/js/tbl_select.js b/js/tbl_select.js index 6b03cced5..3c6cae338 100644 --- a/js/tbl_select.js +++ b/js/tbl_select.js @@ -51,7 +51,7 @@ $(document).ready(function() { event.preventDefault(); // empty previous search results while we are waiting for new results - $("#searchresults").empty(); + $("#sqlqueryresults").empty(); PMA_ajaxShowMessage(PMA_messages['strSearching']); // add this hidden field just once @@ -62,7 +62,8 @@ $(document).ready(function() { $.post($search_form.attr('action'), $search_form.serialize(), function(response) { if (typeof response == 'string') { // found results - $("#searchresults").html(response); + $("#sqlqueryresults").html(response); + $("#sqlqueryresults").trigger('appendAnchor'); $('#tbl_search_form').hide(); $('#togglesearchform') // always start with the Show message @@ -71,7 +72,7 @@ $(document).ready(function() { .show(); } else { // error message (zero rows) - $("#searchresults").html(response['message']); + $("#sqlqueryresults").html(response['message']); } }) }) diff --git a/tbl_select.php b/tbl_select.php index a680c86b8..67bf5d24b 100644 --- a/tbl_select.php +++ b/tbl_select.php @@ -16,6 +16,7 @@ require_once './libraries/common.inc.php'; require_once './libraries/mysql_charsets.lib.php'; +$GLOBALS['js_include'][] = 'sql.js'; $GLOBALS['js_include'][] = 'tbl_select.js'; $GLOBALS['js_include'][] = 'jquery/jquery-ui-1.8.custom.js'; $GLOBALS['js_include'][] = 'jquery/timepicker.js'; @@ -302,7 +303,7 @@ $(function() { -
+