From ca59d7327208df9d31a1da4fabbe643db9aa05a3 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 23 Jan 2024 16:57:45 +0800 Subject: [PATCH] * Fix bug #44589. --- module/tree/js/edit.ui.js | 9 +++++---- module/tree/ui/edit.html.php | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/module/tree/js/edit.ui.js b/module/tree/js/edit.ui.js index 329d7995ee..fc7a2243c1 100644 --- a/module/tree/js/edit.ui.js +++ b/module/tree/js/edit.ui.js @@ -12,9 +12,12 @@ function loadBranches(e) $branchBox.addClass('hidden'); $.get($.createLink('branch', 'ajaxGetBranches', "productID=" + productID + "&oldBranch=0¶m=withClosed"), function(data) { - if(data) + data = JSON.parse(data); + if(data.length > 0) { - $('[name=branch]').zui('picker').render({items: JSON.parse(data), defaultValue: 0, name: 'branch'}); + $branch = $('[name=branch]').zui('picker'); + $branch.render({items: data}); + $branch.$.setValue(''); $branchBox.removeClass('hidden'); } ajaxLoadModules(productID, 0); @@ -32,10 +35,8 @@ function loadModules(e) { var productID = $('[name=root]').val(); var branchID = $(e.target).val(); - if(typeof(branchID) == 'undefined') branchID = 0; - console.log(productID) ajaxLoadModules(productID, branchID); } diff --git a/module/tree/ui/edit.html.php b/module/tree/ui/edit.html.php index 1dfc4825d6..0edff92572 100644 --- a/module/tree/ui/edit.html.php +++ b/module/tree/ui/edit.html.php @@ -33,6 +33,7 @@ formPanel ( formGroup ( + set::width('2/3'), set::label($lang->tree->product), picker ( @@ -44,6 +45,7 @@ formPanel ), $product->type != 'normal' ? formGroup ( + set::width('1/3'), setClass('branchBox'), control (