Skip to content

Commit b94ee40

Browse files
committed
Appease coding standard
See also magento/magento-coding-standard#347
1 parent a3f60e1 commit b94ee40

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

app/code/Magento/User/view/adminhtml/web/js/roles-tree.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ define([
4747
const $tree = $.jstree.reference(this.element),
4848
collapseAllButton = document.createElement('button'),
4949
expandAllButton = document.createElement('button'),
50-
expandUsedButton = document.createElement('button');
50+
expandUsedButton = document.createElement('button'),
51+
parent = this.element[0],
52+
ul = this.element.find('ul')[0];
5153

5254
collapseAllButton.innerText = $.mage.__('Collapse all');
5355
collapseAllButton.addEventListener('click', function () {
@@ -62,11 +64,13 @@ define([
6264
expandUsedButton.innerText = $.mage.__('Expand selected');
6365
expandUsedButton.addEventListener('click', function () {
6466
const hasOpened = [];
67+
6568
$tree.get_checked(true).forEach(function (node) {
6669
$tree.open_node(node);
6770
hasOpened.push(node.id);
6871
for (let i = 0; i < node.parents.length - 1; i++) {
6972
const id = node.parents[i];
73+
7074
if (!hasOpened.includes(id)) {
7175
$tree.open_node($tree.get_node(id));
7276
hasOpened.push(id);
@@ -78,12 +82,9 @@ define([
7882
this.buttons = [
7983
collapseAllButton,
8084
expandAllButton,
81-
expandUsedButton,
85+
expandUsedButton
8286
];
8387

84-
const parent = this.element[0],
85-
ul = this.element.find('ul')[0];
86-
8788
this.buttons.forEach(function (button) {
8889
button.type = 'button';
8990
parent.insertBefore(button, ul);

0 commit comments

Comments
 (0)