65 lines
2.1 KiB
JavaScript
65 lines
2.1 KiB
JavaScript
/* Swtich to search module. */
|
|
function browseBySearch(active)
|
|
{
|
|
$('#querybox').removeClass('hidden');
|
|
$('.divider').addClass('hidden');
|
|
$('#' + active + 'Tab').removeClass('active');
|
|
$('#bysearchTab').addClass('active');
|
|
$('#bymoduleTab').removeClass('active');
|
|
}
|
|
|
|
/**
|
|
* Confirm batch delete cases.
|
|
*
|
|
* @param string $actionLink
|
|
* @access public
|
|
* @return void
|
|
*/
|
|
function confirmBatchDelete(actionLink)
|
|
{
|
|
if(confirm(batchDelete)) setFormAction(actionLink);
|
|
return false;
|
|
}
|
|
|
|
$(document).ready(function()
|
|
{
|
|
if(browseType == 'bysearch') ajaxGetSearchForm();
|
|
setTimeout(function(){fixedTfootAction('#batchForm')}, 100);
|
|
setTimeout(function(){fixedTheadOfList('#caseList')}, 100);
|
|
if($('#caseList thead th.w-title').width() < 150) $('#caseList thead th.w-title').width(150);
|
|
|
|
$('.dropdown-menu .with-search .menu-search').click(function(e)
|
|
{
|
|
e.stopPropagation();
|
|
return false;
|
|
}).on('keyup change paste', 'input', function()
|
|
{
|
|
var val = $(this).val().toLowerCase();
|
|
var $options = $(this).closest('.dropdown-menu.with-search').find('.option');
|
|
if(val == '') return $options.removeClass('hide');
|
|
$options.each(function()
|
|
{
|
|
var $option = $(this);
|
|
$option.toggleClass('hide', $option.text().toString().toLowerCase().indexOf(val) < 0 && $option.data('key').toString().toLowerCase().indexOf(val) < 0);
|
|
});
|
|
});
|
|
|
|
setModal4List('runCase', 'caseList');
|
|
|
|
if(flow == 'onlyTest')
|
|
{
|
|
$('#modulemenu > .nav').append($('#featurebar > .submenu').html());
|
|
|
|
toggleSearch();
|
|
$('.export').modalTrigger({width:650, type:'iframe'});
|
|
|
|
$('#modulemenu > .nav > li').removeClass('active');
|
|
$('#modulemenu > .nav > li[data-id=' + browseType + ']').addClass('active');
|
|
}
|
|
});
|
|
|
|
function setQueryBar(queryID, title)
|
|
{
|
|
$('#bysearchTab').before("<li id='QUERY" + queryID + "Tab' class='active'><a href='" + createLink('testcase', 'browse', "productID=" + productID + "&branch=" + branch + "&browseType=bysearch¶m=" + queryID) + "'>" + title + "</a></li>");
|
|
}
|