Confirm partition actions
Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
This commit is contained in:
parent
8e70f48817
commit
46f2d752a0
@ -85,6 +85,7 @@ AJAX.registerTeardown('tbl_structure.js', function () {
|
||||
$(document).off('click', "#printView");
|
||||
$(document).off('submit', ".append_fields_form.ajax");
|
||||
$('body').off('click', '#fieldsForm.ajax button[name="submit_mult"], #fieldsForm.ajax input[name="submit_mult"]');
|
||||
$(document).off('click', 'a[name^=partition_action].ajax');
|
||||
});
|
||||
|
||||
AJAX.registerOnload('tbl_structure.js', function () {
|
||||
@ -432,6 +433,35 @@ AJAX.registerOnload('tbl_structure.js', function () {
|
||||
AJAX.source = $form;
|
||||
$.post($form.attr('action'), submitData, AJAX.responseHandler);
|
||||
});
|
||||
|
||||
/**
|
||||
* Handles clicks on Action links in parition table
|
||||
*/
|
||||
$(document).on('click', 'a[name^=partition_action].ajax', function (e) {
|
||||
e.preventDefault();
|
||||
var $link = $(this);
|
||||
|
||||
function submitPartitionAction(url) {
|
||||
var submitData = '&ajax_request=true&ajax_page_request=true';
|
||||
PMA_ajaxShowMessage();
|
||||
AJAX.source = $link;
|
||||
$.post(url, submitData, AJAX.responseHandler);
|
||||
}
|
||||
|
||||
if ($link.is('#partition_action_DROP')) {
|
||||
var question = PMA_messages.strDropPartitionWarning;
|
||||
$link.PMA_confirm(question, $link.attr('href'), function (url) {
|
||||
submitPartitionAction(url);
|
||||
});
|
||||
} else if ($link.is('#partition_action_TRUNCATE')) {
|
||||
var question = PMA_messages.strTruncatePartitionWarning;
|
||||
$link.PMA_confirm(question, $link.attr('href'), function (url) {
|
||||
submitPartitionAction(url);
|
||||
});
|
||||
} else {
|
||||
submitPartitionAction($link.attr('href'));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
/** Handler for "More" dropdown in structure table rows */
|
||||
|
||||
@ -56,9 +56,13 @@
|
||||
</td>
|
||||
<?php foreach ($titles as $operation => $title): ?>
|
||||
<td>
|
||||
<a href="tbl_structure.php<?php echo $url_query; ?>&partition_maintenance=1&sql_query=<?php echo urlencode(
|
||||
"ALTER TABLE " . PMA_Util::backquote($table) . $operation . " PARTITION " . $partition->getName()
|
||||
) ?>">
|
||||
<a href="tbl_structure.php<?php echo $url_query; ?>&partition_maintenance=1&sql_query=<?php echo urlencode(
|
||||
"ALTER TABLE " . PMA_Util::backquote($table) . $operation . " PARTITION " . $partition->getName()
|
||||
) ?>"
|
||||
id="partition_action_<?php echo $operation; ?>"
|
||||
name="partition_action_<?php echo $operation; ?>"
|
||||
class="ajax"
|
||||
>
|
||||
<?php echo $title; ?>
|
||||
</a>
|
||||
</td>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user