* adjust for task #2531:Process the post data in model when value is 'ditto'.
This commit is contained in:
@@ -38,36 +38,39 @@ function setDuplicateAndChild(resolution, storyID)
|
||||
}
|
||||
}
|
||||
|
||||
$(document).on('click', '.chosen-with-drop', function()
|
||||
{
|
||||
var $select = $(this).prev('select');
|
||||
oldValue = $select.val();
|
||||
})
|
||||
$(document).on('click', '.chosen-with-drop', function(){oldValue = $(this).prev('select').val();})
|
||||
|
||||
$(document).on('change', 'select', function()
|
||||
{
|
||||
if($(this).val() == 'ditto')
|
||||
{
|
||||
var index = $(this).closest('td').index();
|
||||
var row = $(this).closest('tr').index();
|
||||
var table = $(this).closest('tr').parent();
|
||||
var index = $(this).closest('td').index();
|
||||
var row = $(this).closest('tr').index();
|
||||
var $tbody = $(this).closest('tr').parent();
|
||||
|
||||
var value = '';
|
||||
for(i = row - 1; i >= 0; i--)
|
||||
{
|
||||
value = $(table).find('tr').eq(i).find('td').eq(index).find('select').val();
|
||||
value = $tbody.children('tr').eq(i).find('td').eq(index).find('select').val();
|
||||
if(value != 'ditto') break;
|
||||
}
|
||||
|
||||
var valueStr = ',' + $(this).find('option').map(function(){return $(this).val();}).get().join(',') + ',';
|
||||
if(valueStr.indexOf(',' + value + ',') != -1)
|
||||
if($(this).attr('name').indexOf('modules') != -1)
|
||||
{
|
||||
$(this).val(value);
|
||||
var valueStr = ',' + $(this).find('option').map(function(){return $(this).val();}).get().join(',') + ',';
|
||||
if(valueStr.indexOf(',' + value + ',') != -1)
|
||||
{
|
||||
$(this).val(value);
|
||||
}
|
||||
else
|
||||
{
|
||||
alert(dittoNotice);
|
||||
$(this).val(oldValue);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
alert(dittoNotice);
|
||||
$(this).val(oldValue);
|
||||
$(this).val(value);
|
||||
}
|
||||
|
||||
$(this).trigger("chosen:updated");
|
||||
|
||||
Reference in New Issue
Block a user