* finish task #6414.

This commit is contained in:
wangyidong
2019-10-14 16:22:35 +08:00
parent 33f5465b54
commit 4ce472b509
2 changed files with 25 additions and 24 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ $(document).ready(function()
{
var index = id.substring(5);
var moduleID = $('#module' + index).val();
var branch = $('#branch' + index).val();
var branch = $('#branch' + index).length > 0 ? $('#branch' + index).val() : 0;
if(moduleID == 'ditto')
{
for(var i = index - 1; i >=0; i--)
+24 -23
View File
@@ -1,24 +1,25 @@
$(document).on('change', '.moduleChange', function()
$(document).on('mouseup', '[id^=story].chosen-with-drop', function()
{
var moduleID = $(this).val();
if(typeof(moduleID) == 'undefined') moduleID = 0;
var id = $(this).attr('id');
var index = id.substring(6);
link = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branch + '&moduleID=' + moduleID + '&storyID='+ '' + '&onlyOption=true&status=noclosed');
$('#story' + index).load(link, function(){$(this).trigger("chosen:updated");});
})
$(document).on('change', '.storyChange', function()
{
var storyID = $(this).val();
if(typeof(storyID) == 'undefined') storyID = 0;
var link = createLink('testcase', 'ajaxGetStoryModule', 'storyID=' + storyID);
var id = $(this).attr('id');
var index = id.substring(5);
$.get(link, function(json)
{
var obj = JSON.parse(json);
$("#module" + index).val(obj.moduleID);
$('#module' + index).trigger("chosen:updated");
})
})
var select = $(this).prev('select');
var id = $(select).attr('id');
var index = id.substring(5);
var moduleID = $('#module' + index).val();
var branch = $('#branch' + index).length > 0 ? $('#branch' + index).val() : 0;
if(moduleID == 'ditto')
{
for(var i = index - 1; i >=0; i--)
{
if($('#module' + i).val() != 'ditto')
{
moduleID = $('#module' + i).val();
break;
}
}
}
var link = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branch + '&moduleID=' + moduleID + '&storyID='+ ($(select).val() || '0') + '&onlyOption=true&status=noclosed&limit=0&type=null');
var $story = $('#story' + index);
if($story.data('loadLink') !== link)
{
$story.load(link, function(){$story.data('loadLink', link).trigger("chosen:updated");});
}
});