Improved response of the Truncate table action on success
This commit is contained in:
@@ -36,6 +36,10 @@ $(document).ready(function() {
|
|||||||
* @var question String containing the question to be asked for confirmation
|
* @var question String containing the question to be asked for confirmation
|
||||||
*/
|
*/
|
||||||
var question = 'TRUNCATE ' + curr_table_name;
|
var question = 'TRUNCATE ' + curr_table_name;
|
||||||
|
/**
|
||||||
|
* @var this_anchor Object referring to the anchor clicked
|
||||||
|
*/
|
||||||
|
var this_anchor = $(this);
|
||||||
|
|
||||||
$(this).PMA_confirm(question, $(this).attr('href'), function(url) {
|
$(this).PMA_confirm(question, $(this).attr('href'), function(url) {
|
||||||
|
|
||||||
@@ -44,8 +48,11 @@ $(document).ready(function() {
|
|||||||
$.get(url, {'is_js_confirmed' : 1, 'ajax_request' : true}, function(data) {
|
$.get(url, {'is_js_confirmed' : 1, 'ajax_request' : true}, function(data) {
|
||||||
if(data.success == true) {
|
if(data.success == true) {
|
||||||
PMA_ajaxShowMessage(data.message);
|
PMA_ajaxShowMessage(data.message);
|
||||||
//need to find a better solution here. The icon should be replaced
|
//Remove the action's href and class, so as to disable further attempts to truncate the table
|
||||||
$(this).remove();
|
// @todo: How to replace the icon with the disabled version?
|
||||||
|
$(this_anchor)
|
||||||
|
.removeAttr('href')
|
||||||
|
.removeClass('.truncate_table_anchor');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
PMA_ajaxShowMessage(PMA_messages['strErrorProcessingRequest'] + " : " + data.error);
|
PMA_ajaxShowMessage(PMA_messages['strErrorProcessingRequest'] + " : " + data.error);
|
||||||
|
Reference in New Issue
Block a user