The branch, master has been updated
via d17b0e157d09c67524114f72ab7c1ff824c336f4 (commit)
via a6f5f95600c1ad0b121de79f0d8791ae1612c2f6 (commit)
from 9b4543f2e8950022443575fb4614d6c4d390720b (commit)
- Log -----------------------------------------------------------------
commit d17b0e157d09c67524114f72ab7c1ff824c336f4
Author: Marc Delisle <marc(a)infomarc.info>
Date: Fri Feb 4 13:05:54 2011 -0500
Avoid unneeded DOM traversal
Avoid unneeded wrapping of a jQuery object
commit a6f5f95600c1ad0b121de79f0d8791ae1612c2f6
Author: Jan PrachaĆ <jan.prachar(a)gmail.com>
Date: Fri Feb 4 02:10:50 2011 +0100
Fix ajax dropping multiple column index.
-----------------------------------------------------------------------
Summary of changes:
js/tbl_structure.js | 19 ++++++++++++++-----
1 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/js/tbl_structure.js b/js/tbl_structure.js
index 2720b51..352848c 100644
--- a/js/tbl_structure.js
+++ b/js/tbl_structure.js
@@ -114,21 +114,30 @@ $(document).ready(function() {
$('.drop_primary_key_index_anchor').live('click', function(event) {
event.preventDefault();
+ $anchor = $(this);
+
/**
- * @var curr_row Object containing reference to the current field's row
+ * @var $curr_row Object containing reference to the current field's row
*/
- var curr_row = $(this).parents('tr');
+ var $curr_row = $anchor.parents('tr');
+ /** @var Number of columns in the key */
+ var rows = $anchor.parents('td').attr('rowspan') || 1;
+ /** @var Rows that should be hidden */
+ var $rows_to_hide = $curr_row;
+ for (var i = 1, $last_row = $curr_row.next(); i < rows; i++, $last_row =
$last_row.next()) {
+ $rows_to_hide = $rows_to_hide.add($last_row);
+ }
- var question =
$(curr_row).children('td').children('.drop_primary_key_index_msg').val();
+ var question =
$curr_row.children('td').children('.drop_primary_key_index_msg').val();
- $(this).PMA_confirm(question, $(this).attr('href'), function(url) {
+ $anchor.PMA_confirm(question, $anchor.attr('href'), function(url) {
PMA_ajaxShowMessage(PMA_messages['strDroppingPrimaryKeyIndex']);
$.get(url, {'is_js_confirmed': 1, 'ajax_request': true},
function(data) {
if(data.success == true) {
PMA_ajaxShowMessage(data.message);
- $(curr_row).hide("medium").remove();
+ $rows_to_hide.hide("medium").remove();
}
else {
PMA_ajaxShowMessage(PMA_messages['strErrorProcessingRequest']
+ " : " + data.error);
hooks/post-receive
--
phpMyAdmin
Show replies by date