From 8db8527337182e7ccec5a4e4c87b1eb3af0641b2 Mon Sep 17 00:00:00 2001 From: Rouslan Placella Date: Mon, 13 Jun 2011 15:14:31 +0100 Subject: [PATCH] Show the sql_query to the user when dropping Routines, Events and triggers and fix classes in the list. --- js/db_routines.js | 5 +---- js/functions.js | 14 ++++++++++++++ libraries/db_events.inc.php | 1 + libraries/display_triggers.inc.php | 1 + 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/js/db_routines.js b/js/db_routines.js index 8e5a0e82da..cf62df74ef 100644 --- a/js/db_routines.js +++ b/js/db_routines.js @@ -240,10 +240,7 @@ $(document).ready(function() { * @var ct Count of processed rows. */ var ct = 0; - $('table.data').find('tr').each(function() { - if ($(this).has('th').length) { - return true; - } + $('table.data').find('tr').has('td').each(function() { rowclass = (ct % 2 == 0) ? 'even' : 'odd'; $(this).removeClass().addClass(rowclass); ct++; diff --git a/js/functions.js b/js/functions.js index 392370d10c..fa48228418 100644 --- a/js/functions.js +++ b/js/functions.js @@ -2362,8 +2362,22 @@ $(document).ready(function() { } else { $curr_row.hide("slow", function () { $(this).remove(); + // Now we have removed the row from the list, but maybe + // some row classes are wrong now. So we will itirate + // throught all rows and assign correct classes to them. + /** + * @var ct Count of processed rows. + */ + var ct = 0; + $table.find('tr').has('td').each(function() { + rowclass = (ct % 2 == 0) ? 'even' : 'odd'; + $(this).removeClass().addClass(rowclass); + ct++; + }); }); } + // Show the query that we just executed + $('#js_query_display').html(data.sql_query); } else { PMA_ajaxShowMessage(PMA_messages['strErrorProcessingRequest'] + " : " + data.error); } diff --git a/libraries/db_events.inc.php b/libraries/db_events.inc.php index 2715b67e4f..4040494362 100644 --- a/libraries/db_events.inc.php +++ b/libraries/db_events.inc.php @@ -51,6 +51,7 @@ if (! empty($_GET['exportevent']) && ! empty($_GET['eventname'])) { /** * Display a list of available events */ +echo "\n\n\n\n"; echo '
' . "\n"; echo ' ' . __('Events') . '' . "\n"; if (! $events) { diff --git a/libraries/display_triggers.inc.php b/libraries/display_triggers.inc.php index 65385c00bc..35c33170f2 100644 --- a/libraries/display_triggers.inc.php +++ b/libraries/display_triggers.inc.php @@ -57,6 +57,7 @@ if (! empty($_GET['exporttrigger']) && ! empty($_GET['triggername'])) { /** * Display a list of available triggers */ +echo "\n\n\n\n"; echo '
' . "\n"; echo ' ' . __('Triggers') . '' . "\n"; if (! $triggers) {