* Merge insensitive refresh custom forms into one method.
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
$(document).ready(function()
|
||||
{
|
||||
removeDitto();//Remove 'ditto' in first row.
|
||||
if($('#batchCreateForm table thead tr th.c-title').width() < 170) $('#batchCreateForm table thead tr th.c-title').width('170');
|
||||
var $title = $('#batchCreateForm table thead tr th.c-title');
|
||||
if($title.width() < 170) $title.width('170');
|
||||
|
||||
$(document).keydown(function(event)
|
||||
{
|
||||
@@ -35,35 +36,7 @@ $(document).ready(function()
|
||||
/* Implement a custom form without feeling refresh. */
|
||||
$('#formSettingForm .btn-primary').click(function()
|
||||
{
|
||||
var fields = '';
|
||||
$('#formSettingForm > .checkboxes > .checkbox-primary > input:checked').each(function()
|
||||
{
|
||||
fields += ',' + $(this).val();
|
||||
});
|
||||
|
||||
var link = createLink('custom', 'ajaxSaveCustomFields', 'module=testcase§ion=custom&key=batchCreateFields');
|
||||
$.post(link, {'fields' : fields}, function()
|
||||
{
|
||||
showCheckedFields(fields);
|
||||
$('#formSetting').parent().removeClass('open');
|
||||
|
||||
var fieldCount = $('#batchCreateForm .table thead>tr>th:visible').length;
|
||||
$('.form-actions').attr('colspan', fieldCount);
|
||||
|
||||
if(fieldCount > 8)
|
||||
{
|
||||
$('#batchCreateForm > .table-responsive').removeClass('scroll-none');
|
||||
$('#batchCreateForm > .table-responsive').css('overflow', 'auto');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#batchCreateForm > .table-responsive').addClass('scroll-none');
|
||||
$('#batchCreateForm > .table-responsive').css('overflow', 'visible');
|
||||
}
|
||||
|
||||
if($('#batchCreateForm table thead tr th.c-title').width() < 170) $('#batchCreateForm table thead tr th.c-title').width('170');
|
||||
});
|
||||
|
||||
saveCustomFields('batchCreateFields', 8, $title, 170);
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user