The branch, master has been updated via 7b5c5f902eb1f0f0a17d5193459727c1abb7fa77 (commit) via e61a0a5dc6408816b8933e7a867b8a7ad8eb0fa9 (commit) from f0b647292bbadb77bcdff5663bedb729a6a7e1d1 (commit)
- Log ----------------------------------------------------------------- commit 7b5c5f902eb1f0f0a17d5193459727c1abb7fa77 Author: Marc Delisle marc@infomarc.info Date: Mon Jan 30 04:26:48 2012 -0500
code cleanup
commit e61a0a5dc6408816b8933e7a867b8a7ad8eb0fa9 Author: Eric Krona eric@krona.tm Date: Mon Jan 30 04:13:03 2012 -0500
patch #3481047 for rfe #3480477 Insert as new row enhancement
-----------------------------------------------------------------------
Summary of changes: ChangeLog | 1 + js/tbl_change.js | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog index 9123356..96cc554 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ phpMyAdmin - ChangeLog ======================
3.6.0.0 (not yet released) ++ Patch #3481047 for rfe #3480477 Insert as new row enhancement
3.5.0.0 (not yet released) + rfe #2021981 [interface] Add support for mass prefix change. diff --git a/js/tbl_change.js b/js/tbl_change.js index eaefe58..caa71f0 100644 --- a/js/tbl_change.js +++ b/js/tbl_change.js @@ -281,6 +281,32 @@ $(document).ready(function() { ); });
+ + /** + * Reset the auto_increment column to 0 when selecting any of the + * insert options in submit_type-dropdown. Only perform the reset + * when we are in edit-mode, and not in insert-mode(no previous value + * available). + */ + $('select[name="submit_type"]').bind('change', function (e) { + var auto_increment_column = $('.insertRowTable').find('input[name^="auto_increment"]').attr('name'); + var prev_value_field = $('.insertRowTable').find('input[name="' + auto_increment_column.replace('auto_increment', 'fields_prev') + '"]'); + var value_field = $('.insertRowTable').find('input[name="' + auto_increment_column.replace('auto_increment', 'fields') + '"]'); + + if (auto_increment_column) { + var previous_value = $(prev_value_field).val(); + if (previous_value !== undefined) { + if ($(this).val() == 'insert' || $(this).val() == 'insertignore' || $(this).val() == 'showinsert' ) { + $(value_field).val(0); + } else { + $(value_field).val(previous_value); + } + } + } + + }); + + /** * Submission of data to be inserted or updated *
hooks/post-receive