remove() the dialog properly. Now closing the dialog with the X have the same effect as closing it with buttons.

This commit is contained in:
Madhura Jayaratne 2012-04-29 22:28:34 +05:30
parent 243d59081e
commit 68a4c2b240
4 changed files with 43 additions and 13 deletions

View File

@ -144,10 +144,14 @@ $(function() {
*/
var button_options = {};
// in the following function we need to use $(this)
button_options[PMA_messages['strCancel']] = function() {$(this).dialog('close').remove();}
button_options[PMA_messages['strCancel']] = function() {
$(this).dialog('close');
};
var button_options_error = {};
button_options_error[PMA_messages['strOK']] = function() {$(this).dialog('close').remove();}
button_options_error[PMA_messages['strOK']] = function() {
$(this).dialog('close');
};
var $msgbox = PMA_ajaxShowMessage();
@ -162,6 +166,9 @@ $(function() {
width: 900,
modal: true,
open: PMA_verifyColumnsProperties,
close: function() {
$(this).remove();
},
buttons : button_options_error
})// end dialog options
} else {
@ -173,6 +180,9 @@ $(function() {
width: 900,
modal: true,
open: PMA_verifyColumnsProperties,
close: function() {
$(this).remove();
},
buttons : button_options
});// end dialog options
//Remove the top menu container from the dialog

View File

@ -1575,12 +1575,12 @@ function PMA_createTableDialog( $div, url , target)
var button_options = {};
// in the following function we need to use $(this)
button_options[PMA_messages['strCancel']] = function() {
$(this).closest('.ui-dialog-content').dialog('close').remove();
$(this).closest('.ui-dialog-content').dialog('close');
};
var button_options_error = {};
button_options_error[PMA_messages['strOK']] = function() {
$(this).closest('.ui-dialog-content').dialog('close').remove();
$(this).closest('.ui-dialog-content').dialog('close');
};
// allow create-table form only once
@ -1600,6 +1600,9 @@ function PMA_createTableDialog( $div, url , target)
height: 230,
width: 900,
open: PMA_verifyColumnsProperties,
close: function() {
$(this).remove();
},
buttons : button_options_error
})// end dialog options
//remove the redundant [Back] link in the error message.
@ -1660,6 +1663,7 @@ function PMA_createTableDialog( $div, url , target)
// resize topmenu
menuResize();
menuResize(); // somehow need to call it twice to work
$(this).remove();
},
buttons: button_options
}); // end dialog options
@ -2549,7 +2553,7 @@ $(function() {
};
button_options[PMA_messages['strCancel']] = function() {
$(this).dialog('close').remove();
$(this).dialog('close');
};
$.get($(this).attr('href'), {'ajax_request': true}, function(data) {
$('<div id="change_password_dialog"></div>')

View File

@ -381,10 +381,14 @@ $(function() {
*/
var button_options = {};
// in the following function we need to use $(this)
button_options[PMA_messages['strCancel']] = function() {$(this).dialog('close').remove();};
button_options[PMA_messages['strCancel']] = function() {
$(this).dialog('close');
};
var button_options_error = {};
button_options_error[PMA_messages['strOK']] = function() {$(this).dialog('close').remove();};
button_options_error[PMA_messages['strOK']] = function() {
$(this).dialog('close');
};
var $form = $("#resultsForm");
var $msgbox = PMA_ajaxShowMessage();
@ -399,7 +403,7 @@ $(function() {
width: 900,
open: PMA_verifyColumnsProperties,
close: function(event, ui) {
$('#change_row_dialog').remove();
$(this).remove();
},
buttons : button_options_error
}); // end dialog options
@ -412,7 +416,7 @@ $(function() {
width: 900,
open: PMA_verifyColumnsProperties,
close: function(event, ui) {
$('#change_row_dialog').remove();
$(this).remove();
},
buttons : button_options
})

View File

@ -477,12 +477,12 @@ $(function() {
var button_options = {};
// in the following function we need to use $(this)
button_options[PMA_messages['strCancel']] = function() {
$(this).dialog('close').remove();
$(this).dialog('close');
};
var button_options_error = {};
button_options_error[PMA_messages['strOK']] = function() {
$(this).dialog('close').remove();
$(this).dialog('close');
};
var $msgbox = PMA_ajaxShowMessage();
@ -496,6 +496,9 @@ $(function() {
height: 230,
width: 900,
open: PMA_verifyColumnsProperties,
close: function() {
$(this).remove();
},
modal: true,
buttons : button_options_error
}); // end dialog options
@ -507,6 +510,9 @@ $(function() {
height: 600,
width: 900,
open: PMA_verifyColumnsProperties,
close: function() {
$(this).remove();
},
modal: true,
buttons : button_options
}); // end dialog options
@ -549,12 +555,12 @@ function changeColumns(action,url)
var button_options = {};
// in the following function we need to use $(this)
button_options[PMA_messages['strCancel']] = function() {
$(this).dialog('close').remove();
$(this).dialog('close');
};
var button_options_error = {};
button_options_error[PMA_messages['strOK']] = function() {
$(this).dialog('close').remove();
$(this).dialog('close');
};
var $msgbox = PMA_ajaxShowMessage();
@ -569,6 +575,9 @@ function changeColumns(action,url)
width: 900,
modal: true,
open: PMA_verifyColumnsProperties,
close: function() {
$(this).remove();
},
buttons : button_options_error
}); // end dialog options
} else {
@ -580,6 +589,9 @@ function changeColumns(action,url)
width: 900,
modal: true,
open: PMA_verifyColumnsProperties,
close: function() {
$(this).remove();
},
buttons : button_options
}); // end dialog options
$("#append_fields_form input[name=do_save_data]").addClass("ajax");