* revert ditto function in batchedit.js of bug module.

This commit is contained in:
chenfeiCF
2016-04-14 14:02:35 +08:00
parent 2529a6ba5c
commit 56fac4501d
+28
View File
@@ -26,3 +26,31 @@ $(function()
$(this).trigger("chosen:updated");
});
})
$(document).on('change', 'select', function()
{
if($(this).val() == 'ditto')
{
var index = $(this).closest('td').index();
var row = $(this).closest('tr').index();
var $tbody = $(this).closest('tr').parent();
if($(this).attr('name').indexOf('resolutions') != -1)
{
index = $(this).closest('tr').closest('td').index();
row = $(this).closest('tr').closest('td').parent().index();
$tbody = $(this).closest('tr').closest('td').parent().parent();
}
var value = '';
for(i = row - 1; i >= 0; i--)
{
value = $tbody.children('tr').eq(i).find('td').eq(index).find('select').val();
if(value != 'ditto') break;
}
$(this).val(value);
$(this).trigger("chosen:updated");
$(this).trigger("change");
}
})