Files
EasySoft-ZenTaoPMS/module/release/js/view.js
2019-08-21 10:30:20 +08:00

44 lines
1.6 KiB
JavaScript

function showLink(releaseID, type, param)
{
var method = type == 'story' ? 'linkStory' : 'linkBug';
if(typeof(param) == 'undefined') param = '&browseType=' + type + '&param=0';
if(type == 'leftBug') param += '&type=leftBug';
$.get(createLink('release', method, 'releaseID=' + releaseID + param), function(data)
{
var $pane = $(type == 'story' ? '#stories' : (type == 'leftBug' ? '#leftBugs' : '#bugs'));
$pane.find('.main-table').hide();
var $linkBox = $pane.find('.linkBox').html(data).removeClass('hidden');
$linkBox.find('[data-ride="table"]').table();
$.toggleQueryBox(true, $linkBox.find('#queryBox'));
});
$('.actions').find("a[href*='" + type + "']").addClass('hidden');
}
$(function()
{
if(link == 'true') showLink(releaseID, type, param);
var infoShowed = false;
$('.nav.nav-tabs a[data-toggle="tab"]').on('shown.zui.tab', function(e)
{
var href = $(e.target).attr('href');
var tabPane = $(href + '.tab-pane');
if(tabPane.size() == 0) return;
var formID = tabPane.find('.linkBox').find('form:last');
if(formID.size() == 0) formID = tabPane.find('form:last');
if(href == '#releaseInfo' && !infoShowed)
{
var $tr = $('#releaseInfo .detail-content .table-data tbody tr:first');
width = $tr.width() - $tr.find('th').width();
$('#releaseInfo img').each(function()
{
if($(this).parent().prop('tagName').toLowerCase() == 'a') $(this).unwrap();
setImageSize($(this), width, 0);
});
infoShowed = true;
}
});
})