Skip to content

Commit

Permalink
Appease current coding standard
Browse files Browse the repository at this point in the history
  • Loading branch information
fredden committed Nov 22, 2022
1 parent eae7a1f commit 7e01a64
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions app/code/Magento/User/view/adminhtml/web/js/roles-tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ define([
'jquery',
'jquery/ui',
'jquery/jstree/jquery.jstree',
'mage/translate',
'mage/translate'
], function ($) {
'use strict';

Expand Down Expand Up @@ -44,21 +44,21 @@ define([
},

_createButtons: function () {
const $tree = $.jstree.reference(this.element);
const $tree = $.jstree.reference(this.element),
collapseAllButton = document.createElement('button'),
expandAllButton = document.createElement('button'),
expandUsedButton = document.createElement('button');

const collapseAllButton = document.createElement('button');
collapseAllButton.innerText = $.mage.__('Collapse all');
collapseAllButton.addEventListener('click', function () {
$tree.close_all();
});

const expandAllButton = document.createElement('button');
expandAllButton.innerText = $.mage.__('Expand all');
expandAllButton.addEventListener('click', function () {
$tree.open_all();
});

const expandUsedButton = document.createElement('button');
expandUsedButton.innerText = $.mage.__('Expand selected');
expandUsedButton.addEventListener('click', function () {
const hasOpened = [];
Expand All @@ -81,8 +81,9 @@ define([
expandUsedButton,
];

const parent = this.element[0];
const ul = this.element.find('ul')[0];
const parent = this.element[0],
ul = this.element.find('ul')[0];

this.buttons.forEach(function (button) {
button.type = 'button';
parent.insertBefore(button, ul);
Expand Down

0 comments on commit 7e01a64

Please sign in to comment.