* Rename method names.

This commit is contained in:
hufangzhou
2022-07-11 14:57:43 +08:00
parent 2993ba53f8
commit 21dbff52ca
6 changed files with 33 additions and 33 deletions
+5 -5
View File
@@ -150,15 +150,15 @@ function loadBranches(product)
$inputgroup.addClass('has-branch').append(data);
$inputgroup.find('select:last').attr('name', 'branch[' + index + ']').attr('id', 'branch' + index).attr('onchange', "loadPlans('#products" + index + "', this.value)").chosen();
$inputgroup.find('select:last').each(nonClickableSelectedBranch);
nonClickableSelectedProduct();
$inputgroup.find('select:last').each(disableSelectedBranch);
disableSelectedProduct();
}
var branchID = $('#branch' + index).val();
loadPlans(product, branchID);
});
if(!multiBranchProducts[$(product).val()]) nonClickableSelectedProduct();
if(!multiBranchProducts[$(product).val()]) disableSelectedProduct();
}
/**
@@ -230,7 +230,7 @@ function adjustPlanBoxMargin()
*
* @return void
*/
function nonClickableSelectedProduct()
function disableSelectedProduct()
{
$("select[id^='products'] option[disabled='disabled']").removeAttr('disabled');
@@ -264,7 +264,7 @@ function nonClickableSelectedProduct()
*
* @return void
*/
function nonClickableSelectedBranch()
function disableSelectedBranch()
{
var relatedProduct = $(this).siblings("select[id^='products']").val();
+5 -5
View File
@@ -118,21 +118,21 @@ $(function()
});
/* Init for copy execution. */
$("select[id^=branch]").each(nonClickableSelectedBranch);
nonClickableSelectedProduct();
$("select[id^=branch]").each(disableSelectedBranch);
disableSelectedProduct();
/* Check the all products and branches control when uncheck the product. */
$(document).on('change', "select[id^='products']", function()
{
if($(this).val() == 0)
{
$("select[id^='branch']").each(nonClickableSelectedBranch);
$("select[id^='branch']").each(disableSelectedBranch);
nonClickableSelectedProduct();
disableSelectedProduct();
}
});
$(document).on('change', "select[id^='branch']", nonClickableSelectedBranch);
$(document).on('change', "select[id^='branch']", disableSelectedBranch);
});
function showLifeTimeTips()
+5 -5
View File
@@ -72,21 +72,21 @@ $(function()
});
/* Init. */
$("select[id^=branch]").each(nonClickableSelectedBranch);
nonClickableSelectedProduct();
$("select[id^=branch]").each(disableSelectedBranch);
disableSelectedProduct();
/* Check the all products and branches control when uncheck the product. */
$(document).on('change', "select[id^='products']", function()
{
if($(this).val() == 0)
{
$("select[id^='branch']").each(nonClickableSelectedBranch);
$("select[id^='branch']").each(disableSelectedBranch);
nonClickableSelectedProduct();
disableSelectedProduct();
}
});
$(document).on('change', "select[id^='branch']", nonClickableSelectedBranch);
$(document).on('change', "select[id^='branch']", disableSelectedBranch);
})
var lastProjectID = $("#project").val();
+5 -5
View File
@@ -102,7 +102,7 @@ function computeWorkDays(currentID)
*
* @return void
*/
function nonClickableSelectedProduct()
function disableSelectedProduct()
{
$("select[id^='products'] option[disabled='disabled']").removeAttr('disabled');
@@ -136,7 +136,7 @@ function nonClickableSelectedProduct()
*
* @return void
*/
function nonClickableSelectedBranch()
function disableSelectedBranch()
{
var relatedProduct = $(this).siblings("select[id^='products']").val();
@@ -292,12 +292,12 @@ function loadBranches(product)
$inputgroup.addClass('has-branch').append(data);
$inputgroup.find('select:last').attr('name', 'branch[' + index + ']').attr('id', 'branch' + index).attr('onchange', "loadPlans('#products" + index + "', this.value)").chosen();
$inputgroup.find('select:last').each(nonClickableSelectedBranch);
nonClickableSelectedProduct();
$inputgroup.find('select:last').each(disableSelectedBranch);
disableSelectedProduct();
}
});
if(!multiBranchProducts[$(product).val()]) nonClickableSelectedProduct();
if(!multiBranchProducts[$(product).val()]) disableSelectedProduct();
$("input[name='products[" + index + "]']").remove();
$("input[name='branch[" + index + "]']").remove();
+8 -8
View File
@@ -67,21 +67,21 @@ $(function()
}
/* Init for copy execution. */
$("select[id^=branch]").each(nonClickableSelectedBranch);
nonClickableSelectedProduct();
$("select[id^=branch]").each(disableSelectedBranch);
disableSelectedProduct();
/* Check the all products and branches control when uncheck the product. */
$(document).on('change', "select[id^='products']", function()
{
if($(this).val() == 0)
{
$("select[id^='branch']").each(nonClickableSelectedBranch);
$("select[id^='branch']").each(disableSelectedBranch);
nonClickableSelectedProduct();
disableSelectedProduct();
}
});
$(document).on('change', "select[id^='branch']", nonClickableSelectedBranch);
$(document).on('change', "select[id^='branch']", disableSelectedBranch);
});
/**
@@ -218,12 +218,12 @@ function loadBranches(product, branchID)
$inputgroup.addClass('has-branch').append(data);
$inputgroup.find('select:last').attr('name', 'branch[' + index + ']').attr('id', 'branch' + index).attr('onchange', "loadPlans('#products" + index + "', this.value)").chosen();
$inputgroup.find('select:last').each(nonClickableSelectedBranch);
nonClickableSelectedProduct();
$inputgroup.find('select:last').each(disableSelectedBranch);
disableSelectedProduct();
}
});
if(!multiBranchProducts[$(product).val()]) nonClickableSelectedProduct();
if(!multiBranchProducts[$(product).val()]) disableSelectedProduct();
loadPlans(product, oldBranchID);
}
+5 -5
View File
@@ -131,21 +131,21 @@ $(function()
});
/* Init. */
$("select[id^=branch]").each(nonClickableSelectedBranch);
nonClickableSelectedProduct();
$("select[id^=branch]").each(disableSelectedBranch);
disableSelectedProduct();
/* Check the all products and branches control when uncheck the product. */
$(document).on('change', "select[id^='products']", function()
{
if($(this).val() == 0)
{
$("select[id^='branch']").each(nonClickableSelectedBranch);
$("select[id^='branch']").each(disableSelectedBranch);
nonClickableSelectedProduct();
disableSelectedProduct();
}
});
$(document).on('change', "select[id^='branch']", nonClickableSelectedBranch);
$(document).on('change', "select[id^='branch']", disableSelectedBranch);
});
/**