Improved fix for issue#1 from bug #3204461 - "Continue insertion" and some column types

This commit is contained in:
Rouslan Placella
2011-04-02 18:26:30 +01:00
committed by Michal Čihař
parent 523ac3b626
commit ecd7ab7f1c

View File

@@ -336,6 +336,11 @@ $(document).ready(function() {
*/ */
var target_rows = $("#insert_rows").val(); var target_rows = $("#insert_rows").val();
// remove all datepickers
$('.datefield,.datetimefield').each(function(){
$(this).datepicker('destroy');
});
if(curr_rows < target_rows ) { if(curr_rows < target_rows ) {
while( curr_rows < target_rows ) { while( curr_rows < target_rows ) {
@@ -400,13 +405,6 @@ $(document).ready(function() {
$changed_element.closest('tr').find('span.column_type').html() $changed_element.closest('tr').find('span.column_type').html()
); );
}); });
if ($this_element.is('.datefield') || $this_element.is('.datetimefield')) {
// we now need to remove the remainings of the datepicker
// from the element that we cloned
$this_element.removeClass('hasDatepicker').next().remove();
// and bind a new datepicker
PMA_addDatepicker($this_element);
}
} }
if ($this_element.is('.checkbox_null')) { if ($this_element.is('.checkbox_null')) {
@@ -479,12 +477,18 @@ $(document).ready(function() {
.each(function() { .each(function() {
tabindex++; tabindex++;
$(this).attr('tabindex', tabindex); $(this).attr('tabindex', tabindex);
// update the IDs of textfields to ensure that they are unique
$(this).attr('id', "field_" + tabindex + "_3");
}); });
$('.control_at_footer') $('.control_at_footer')
.each(function() { .each(function() {
tabindex++; tabindex++;
$(this).attr('tabindex', tabindex); $(this).attr('tabindex', tabindex);
}); });
// Add all the required datepickers back
$('.datefield,.datetimefield').each(function(){
PMA_addDatepicker($(this));
});
} }
else if( curr_rows > target_rows) { else if( curr_rows > target_rows) {
while(curr_rows > target_rows) { while(curr_rows > target_rows) {