Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 2 files changed
  • 0 comments
  • 1 contributor

Showing 2 changed files with 38 additions and 6 deletions. Show diff stats Hide diff stats

  1. +30 4 js/tbl_structure.js
  2. +8 2 tbl_alter.php
34 js/tbl_structure.js
@@ -403,8 +403,31 @@ $(function() {
403 403 buttons: button_options_error
404 404 }); // end dialog options
405 405 } else {
  406 + // sort the fields table
  407 + var $fields_table = $("table#tablestructure tbody");
  408 + // remove all existing rows and remember them
  409 + var $rows = $fields_table.find("tr").remove();
  410 + // loop through the correct order
  411 + for (var i in data.columns) {
  412 + var the_column = data.columns[i];
  413 + var $the_row
  414 + = $rows
  415 + .find("input:checkbox[value=" + the_column + "]")
  416 + .closest("tr");
  417 + // append the row for this column to the table
  418 + $fields_table.append($the_row);
  419 + }
  420 + var $firstrow = $fields_table.find("tr").eq(0);
  421 + // Adjust the row numbers and colors
  422 + for (var $row = $firstrow; $row.length > 0; $row = $row.next()) {
  423 + $row
  424 + .find('td:nth-child(2)')
  425 + .text($row.index() + 1)
  426 + .end()
  427 + .removeClass("odd even")
  428 + .addClass($row.index() % 2 == 0 ? "odd" : "even");
  429 + }
406 430 PMA_ajaxShowMessage(data.message);
407   - reloadFieldForm();
408 431 $this.dialog('close');
409 432 }
410 433 });
@@ -619,6 +642,7 @@ $(function() {
619 642 if ($form.hasClass('ajax')) {
620 643 PMA_prepareForAjaxRequest($form);
621 644 //User wants to submit the form
  645 + PMA_ajaxShowMessage();
622 646 $.post($form.attr('action'), $form.serialize()+"&do_save_data=Save", function(data) {
623 647 if ($("#sqlqueryresults").length != 0) {
624 648 $("#sqlqueryresults").remove();
@@ -626,7 +650,6 @@ $(function() {
626 650 $(".error").remove();
627 651 }
628 652 if (data.success == true) {
629   - PMA_ajaxShowMessage(data.message);
630 653 $("<div id='sqlqueryresults'></div>").insertAfter("#floating_menubar");
631 654 $("#sqlqueryresults").html(data.sql_query);
632 655 $("#result_query .notice").remove();
@@ -637,7 +660,7 @@ $(function() {
637 660 $("#add_columns").dialog("close").remove();
638 661 }
639 662 /*Reload the field form*/
640   - reloadFieldForm();
  663 + reloadFieldForm(data.message);
641 664 } else {
642 665 var $temp_div = $("<div id='temp_div'><div>").append(data);
643 666 var $error = $temp_div.find(".error code").addClass("error");
@@ -657,7 +680,7 @@ $(function() {
657 680 /**
658 681 * Reload fields table
659 682 */
660   -function reloadFieldForm() {
  683 +function reloadFieldForm(message) {
661 684 $.post($("#fieldsForm").attr('action'), $("#fieldsForm").serialize()+"&ajax_request=true", function(form_data) {
662 685 var $temp_div = $("<div id='temp_div'><div>").append(form_data);
663 686 $("#fieldsForm").replaceWith($temp_div.find("#fieldsForm"));
@@ -668,6 +691,9 @@ function reloadFieldForm() {
668 691 $table_clone = false;
669 692 $("div.replace_in_more").hide(); // fix "more" dropdown
670 693 moreOptsMenuResize();
  694 + setTimeout(function() {
  695 + PMA_ajaxShowMessage(message);
  696 + }, 500);
671 697 });
672 698 }
673 699
10 tbl_alter.php
@@ -39,7 +39,7 @@
39 39 /**
40 40 * Moving columns
41 41 */
42   -if (isset($_REQUEST['move_columns'])
  42 +if (isset($_REQUEST['move_columns'])
43 43 && is_array($_REQUEST['move_columns'])
44 44 && $GLOBALS['is_ajax_request']) {
45 45 /*
@@ -127,7 +127,13 @@
127 127 if ($tmp_error) {
128 128 PMA_ajaxResponse(PMA_Message::error($tmp_error), false);
129 129 }
130   - PMA_ajaxResponse(PMA_Message::success(__('The columns have been moved successfully.')), true);
  130 + PMA_ajaxResponse(
  131 + PMA_Message::success(__('The columns have been moved successfully.')),
  132 + true,
  133 + array(
  134 + 'columns' => $column_names
  135 + )
  136 + );
131 137 }
132 138
133 139 /**

No commit comments for this range

Something went wrong with that request. Please try again.