@@ -10,7 +10,7 @@ define([
10
10
'jquery' ,
11
11
'jquery/ui' ,
12
12
'jquery/jstree/jquery.jstree' ,
13
- 'mage/translate' ,
13
+ 'mage/translate'
14
14
] , function ( $ ) {
15
15
'use strict' ;
16
16
@@ -44,21 +44,21 @@ define([
44
44
} ,
45
45
46
46
_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' ) ;
48
51
49
- const collapseAllButton = document . createElement ( 'button' ) ;
50
52
collapseAllButton . innerText = $ . mage . __ ( 'Collapse all' ) ;
51
53
collapseAllButton . addEventListener ( 'click' , function ( ) {
52
54
$tree . close_all ( ) ;
53
55
} ) ;
54
56
55
- const expandAllButton = document . createElement ( 'button' ) ;
56
57
expandAllButton . innerText = $ . mage . __ ( 'Expand all' ) ;
57
58
expandAllButton . addEventListener ( 'click' , function ( ) {
58
59
$tree . open_all ( ) ;
59
60
} ) ;
60
61
61
- const expandUsedButton = document . createElement ( 'button' ) ;
62
62
expandUsedButton . innerText = $ . mage . __ ( 'Expand selected' ) ;
63
63
expandUsedButton . addEventListener ( 'click' , function ( ) {
64
64
const hasOpened = [ ] ;
@@ -81,8 +81,9 @@ define([
81
81
expandUsedButton ,
82
82
] ;
83
83
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
+
86
87
this . buttons . forEach ( function ( button ) {
87
88
button . type = 'button' ;
88
89
parent . insertBefore ( button , ul ) ;
0 commit comments