* Finish task #85646.

This commit is contained in:
liumengyi
2023-03-01 02:52:05 +00:00
parent 2a8ef84795
commit 6529c78e32
+12 -5
View File
@@ -62,6 +62,13 @@ $(function()
bootbox.alert(unLinkProductTip.replace("%s", allProducts[last]));
}
}
var chosenProducts = 0;
$(".productsBox select[name^='products']").each(function()
{
if($(this).val() > 0) chosenProducts ++;
});
if(chosenProducts > 1) $('.division').removeClass('hide');
if(chosenProducts <= 1) $('.division').addClass('hide');
});
$(document).on('change', '[name*=branch]', function()
@@ -198,7 +205,7 @@ function loadBranches(product)
}
});
(chosenProducts.length > 1 && model == 'waterfall') ? $('.division').removeClass('hide') : $('.division').addClass('hide');
(chosenProducts.length > 1 && model == 'waterfall' && model == 'waterfallplus') ? $('.division').removeClass('hide') : $('.division').addClass('hide');
var $tableRow = $(product).closest('.table-row');
var index = $tableRow.find('select:first').attr('id').replace('products' , '');
@@ -255,15 +262,15 @@ function loadPlans(product, branch)
/**
* Add new line for link product.
*
* @param obj $obj
*
* @param obj $obj
* @access public
* @return void
*/
function addNewLine(obj)
{
var newLine = $(obj).closest('tr').clone();
var index = 0;
var index = 0;
$(".productsBox select[name^='products']").each(function()
{
var id = $(this).attr('id').replace('products' , '');
@@ -294,5 +301,5 @@ function removeLine(obj)
{
$(obj).closest('tr').remove();
disableSelectedProduct();
if($("select[name^='products']").length < 2) $('.division').addClass('hide');
if($("select[name^='products']").length < 2) $('.division').addClass('hide');
}