From 21dbff52caf4ed587df90eb57990ab3c5d9f9ae5 Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Mon, 11 Jul 2022 14:57:43 +0800 Subject: [PATCH] * Rename method names. --- module/execution/js/common.js | 10 +++++----- module/execution/js/create.js | 10 +++++----- module/execution/js/edit.js | 10 +++++----- module/project/js/common.js | 10 +++++----- module/project/js/create.js | 16 ++++++++-------- module/project/js/edit.js | 10 +++++----- 6 files changed, 33 insertions(+), 33 deletions(-) diff --git a/module/execution/js/common.js b/module/execution/js/common.js index 5e02114f42..2108083f47 100644 --- a/module/execution/js/common.js +++ b/module/execution/js/common.js @@ -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(); diff --git a/module/execution/js/create.js b/module/execution/js/create.js index 707111ebaf..3aa6046ffd 100644 --- a/module/execution/js/create.js +++ b/module/execution/js/create.js @@ -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() diff --git a/module/execution/js/edit.js b/module/execution/js/edit.js index 90f14f5bbf..0017e84793 100644 --- a/module/execution/js/edit.js +++ b/module/execution/js/edit.js @@ -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(); diff --git a/module/project/js/common.js b/module/project/js/common.js index b45459e0d0..47c050ff3a 100644 --- a/module/project/js/common.js +++ b/module/project/js/common.js @@ -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(); diff --git a/module/project/js/create.js b/module/project/js/create.js index cc7f773adb..f340e79cde 100644 --- a/module/project/js/create.js +++ b/module/project/js/create.js @@ -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); } diff --git a/module/project/js/edit.js b/module/project/js/edit.js index 7060af8a60..266e060664 100644 --- a/module/project/js/edit.js +++ b/module/project/js/edit.js @@ -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); }); /**