diff --git a/js/functions.js b/js/functions.js index 63edd90a7..09df37194 100755 --- a/js/functions.js +++ b/js/functions.js @@ -1929,4 +1929,36 @@ $(document).ready(function() { }) // end $.get }) }) -}); //end $(document).ready() for libraries/tbl_links.inc.php \ No newline at end of file +}); //end $(document).ready() for libraries/tbl_links.inc.php + +/** + * jQuery coding for Drop Trigger. Used on tbl_structure.php + */ +$(document).ready(function() { + + $(".drop_trigger_anchor").live('click', function(event) { + event.preventDefault(); + + var curr_row = $(this).parents('tr'); + var question = 'DROP TRIGGER IF EXISTS `' + $(curr_row).children('td:first').text() + '`'; + + $(this).PMA_confirm(question, $(this).attr('href'), function(url) { + + PMA_ajaxShowMessage(PMA_messages['strProcessingRequest']); + $.get(url, {'is_js_confirmed': 1, 'ajax_request': true}, function(data) { + if(data.success == true) { + PMA_ajaxShowMessage(data.message); + $("#topmenucontainer") + .next('div') + .remove() + .end() + .after(data.sql_query); + $(curr_row).hide("medium").remove(); + } + else { + PMA_ajaxShowMessage(data.error); + } + }) // end $.get + }) + }) +}); //end $(document).ready() for Drop Trigger \ No newline at end of file diff --git a/libraries/tbl_triggers.lib.php b/libraries/tbl_triggers.lib.php index d397b3c2e..18bf4ea21 100755 --- a/libraries/tbl_triggers.lib.php +++ b/libraries/tbl_triggers.lib.php @@ -42,7 +42,7 @@ if ($triggers) { ($ct%2 == 0) ? 'even' : 'odd', $trigger['name'], PMA_linkOrButton('tbl_sql.php?' . $url_query . '&sql_query=' . urlencode($drop_and_create) . '&show_query=1&delimiter=' . urlencode($delimiter), $titles['Change']), - '' . $titles['Drop'] . '', + '' . $titles['Drop'] . '', $trigger['action_timing'], $trigger['event_manipulation']); $ct++;