This commit is contained in:
刘刚
2024-02-29 15:41:26 +08:00
parent 9d12fa37fd
commit c30a71f983
2 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -4,7 +4,7 @@ window.branchChange = function(e)
loadPlans($product, $(e.target));
}
function loadBranches(e)
window.loadBranches = function(e)
{
/* When selecting a product, delete a plan that is empty by default. */
$("#planDefault").remove();
@@ -52,7 +52,7 @@ function loadBranches(e)
loadPlans(e.target, branch.length > 0 ? branch[0] : branch);
}
function addNewLine(e)
window.addNewLine = function(e)
{
const obj = e.target
const newLine = $(obj).closest('.productBox').clone();
@@ -96,7 +96,7 @@ function addNewLine(e)
new zui.Picker(`#plans${index}`, {items:[], multiple: true, name: `plans[${index}]`});
}
function removeLine(e)
window.removeLine = function(e)
{
const obj = e.target;
$(obj).closest('.productBox').remove();
+3 -3
View File
@@ -58,9 +58,9 @@ class productsBox extends wg
return div
(
setClass('productsBox'),
on::click('.productsBox .addLine', 'addNewLine'),
on::click('.productsBox .removeLine', 'removeLine'),
on::change('.productsBox [name^=products]', 'loadBranches'),
on::click('.productsBox .addLine', 'window.addNewLine'),
on::click('.productsBox .removeLine', 'window.removeLine'),
on::change('.productsBox [name^=products]', 'window.loadBranches'),
jsVar('multiBranchProducts', data('multiBranchProducts')),
jsVar('project', \zget($project, 'id', 0)),
jsVar('errorSameProducts', $errorSameProducts),