Skip to content

Commit a70c27a

Browse files
committed
AC-12692: Widget category tree is not rendered correctly
1 parent 43e9296 commit a70c27a

File tree

1 file changed

+7
-7
lines changed
  • app/code/Magento/Catalog/view/adminhtml/templates/catalog/category/widget

1 file changed

+7
-7
lines changed

app/code/Magento/Catalog/view/adminhtml/templates/catalog/category/widget/tree.phtml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@ require(['jquery', 'jquery/jstree/jquery.jstree'], function($) {
2828
let nonAnchorNodes = [];
2929
3030
function actionBasedOnIsAnchorOnly() {
31-
if(isAnchorOnly){
31+
if (isAnchorOnly) {
3232
tree.jstree(true).disable_node(nonAnchorNodes);
33-
}else{
33+
} else {
3434
tree.jstree(true).disable_node(anchorNodes);
3535
}
3636
}
3737
3838
function handleLoadedNode(e, data) {
3939
const container = $(e.target).closest('div.chooser_container');
40-
if(container.find('input[type="text"].entities').val() !== ''){
40+
if (container.find('input[type="text"].entities').val() !== '') {
4141
checkedNodes = container.find('input[type="text"].entities').val().split(',').map(item => item.trim());
4242
}
4343
@@ -80,9 +80,9 @@ require(['jquery', 'jquery/jstree/jquery.jstree'], function($) {
8080
updateChildrenKey(node.children);
8181
}
8282
83-
if(node.is_anchor === 1){
83+
if (node.is_anchor === 1) {
8484
anchorNodes.push(node.id);
85-
}else{
85+
} else {
8686
nonAnchorNodes.push(node.id);
8787
}
8888
});
@@ -92,7 +92,7 @@ require(['jquery', 'jquery/jstree/jquery.jstree'], function($) {
9292
var jstreeConfig = {
9393
core: {
9494
data: function (obj, callback) {
95-
if(obj.id != '#' && obj.children.length === 0){
95+
if (obj.id != '#' && obj.children.length === 0) {
9696
let data = {
9797
id: obj.id,
9898
store: obj.original.store,
@@ -113,7 +113,7 @@ require(['jquery', 'jquery/jstree/jquery.jstree'], function($) {
113113
console.log(status + ': ' + error);
114114
}
115115
});
116-
}else{
116+
} else {
117117
let defaultTree = updateChildrenKey({$block->getTreeJson()});
118118
callback.call(this, defaultTree);
119119
}

0 commit comments

Comments
 (0)