* code for task #89916.

This commit is contained in:
wangyidong
2023-04-07 12:30:10 +08:00
parent adb4e70bda
commit 56ae0cf008
2 changed files with 18 additions and 27 deletions
+2
View File
@@ -1 +1,3 @@
#lib_chosen.chosen-container .chosen-results {max-height: 100px;}
.radio-inline+.radio-inline { margin-top: 0; margin-left: 0px;}
.radio-inline {margin-right: 10px;}
+16 -27
View File
@@ -62,20 +62,26 @@
*/
function changeSpace()
{
var space = $('[name=space]:checked').val();
var docType = $('[name=type]:checked').val();
console.log();
var space = $('[name=space]:checked').val();
$('.apiTypeTR').toggleClass('hidden', space != 'api');
$('.projectTR').toggleClass('hidden', space != 'project');
$('.productTR').toggleClass('hidden', space != 'product');
$('#typeapi').removeAttr('disabled');
$('#typedoc').removeAttr('disabled');
if(space == 'mine' || space == 'custom') $('#typeapi').attr('disabled', 'disabled');
if(space == 'api') $('#typedoc').attr('disabled', 'disabled');
$('#typedoc').toggleClass('hidden', space == 'api');
$('#typeapi').toggleClass('hidden', space == 'mine' || space == 'custom');
$('#typedoc').closest('.radio-inline').toggleClass('hidden', space == 'api');
$('#typeapi').closest('.radio-inline').toggleClass('hidden', space == 'mine' || space == 'custom');
var docType = $('[name=type]:not(.hidden):checked').val();
if(space == 'project' && docType) $('#project').change();
if(space == 'product' && docType) $('#product').change();
if((space == 'mine' || space == 'custom') && docType) loadDocLibs(space, docType);
if(space == 'api' && docType) changeApiType();
if(!docType)
{
$('[name=type]:not(.hidden):first').prop('checked', true);
changeDocType();
}
}
/**
@@ -102,40 +108,23 @@ function changeApiType()
*/
function changeDocType()
{
var docType = $('[name=type]:checked').val();
$('[name=space]').removeAttr('disabled');
var docType = $('[name=type]:not(.hidden):checked').val();
$('.executionTH').removeClass('hidden');
$('#executionBox').removeClass('hidden');
if(docType == 'api')
{
$('#spacemine').attr('disabled', 'disabled');
$('#spacecustom').attr('disabled', 'disabled');
$('.executionTH').addClass('hidden');
$('#executionBox').addClass('hidden');
$('#project').attr('onchange', "loadObjectModules('project', this.value, '" + docType + "')");
}
if(docType == 'doc')
else if(docType == 'doc')
{
$('#spaceapi').attr('disabled', 'disabled');
$('#project').attr('onchange', "loadExecutions(this.value)");
}
$('#product').attr('onchange', "loadObjectModules('product', this.value, '" + docType + "')");
var space = $('[name=space]:checked').val();
if(space)
{
if(docType == 'doc' && space == 'api')
{
$('[name=space]:checked').prop('checked', false);
$('[name=space]:not(:disabled):first').prop('checked', true);
}
if(docType == 'api' && (space == 'mine' || space == 'custom'))
{
$('[name=space]:checked').prop('checked', false);
$('[name=space]:not(:disabled):first').prop('checked', true);
}
changeSpace();
}
if(space) changeSpace();
$('#submit').removeAttr('disabled');
}