* Merge insensitive refresh custom forms into one method.

This commit is contained in:
tianshujie
2022-07-07 10:44:29 +08:00
parent 40ca319394
commit 5ccd62ea84
17 changed files with 223 additions and 435 deletions
+3 -30
View File
@@ -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&section=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;
});
});