* Rename method names.
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user