@@ -10,7 +10,7 @@ define([
1010 'jquery' ,
1111 'jquery/ui' ,
1212 'jquery/jstree/jquery.jstree' ,
13- 'mage/translate' ,
13+ 'mage/translate'
1414] , function ( $ ) {
1515 'use strict' ;
1616
@@ -44,21 +44,21 @@ define([
4444 } ,
4545
4646 _createButtons : function ( ) {
47- const $tree = $ . jstree . reference ( this . element ) ;
47+ const $tree = $ . jstree . reference ( this . element ) ,
48+ collapseAllButton = document . createElement ( 'button' ) ,
49+ expandAllButton = document . createElement ( 'button' ) ,
50+ expandUsedButton = document . createElement ( 'button' ) ;
4851
49- const collapseAllButton = document . createElement ( 'button' ) ;
5052 collapseAllButton . innerText = $ . mage . __ ( 'Collapse all' ) ;
5153 collapseAllButton . addEventListener ( 'click' , function ( ) {
5254 $tree . close_all ( ) ;
5355 } ) ;
5456
55- const expandAllButton = document . createElement ( 'button' ) ;
5657 expandAllButton . innerText = $ . mage . __ ( 'Expand all' ) ;
5758 expandAllButton . addEventListener ( 'click' , function ( ) {
5859 $tree . open_all ( ) ;
5960 } ) ;
6061
61- const expandUsedButton = document . createElement ( 'button' ) ;
6262 expandUsedButton . innerText = $ . mage . __ ( 'Expand selected' ) ;
6363 expandUsedButton . addEventListener ( 'click' , function ( ) {
6464 const hasOpened = [ ] ;
@@ -81,8 +81,9 @@ define([
8181 expandUsedButton ,
8282 ] ;
8383
84- const parent = this . element [ 0 ] ;
85- const ul = this . element . find ( 'ul' ) [ 0 ] ;
84+ const parent = this . element [ 0 ] ,
85+ ul = this . element . find ( 'ul' ) [ 0 ] ;
86+
8687 this . buttons . forEach ( function ( button ) {
8788 button . type = 'button' ;
8889 parent . insertBefore ( button , ul ) ;
0 commit comments