File tree 3 files changed +16
-8
lines changed
FrameworkBundle/Resources/public/images
WebProfilerBundle/Resources/views 3 files changed +16
-8
lines changed Original file line number Diff line number Diff line change 59
59
.tree a {
60
60
text-decoration : none ;
61
61
}
62
- .tree button {
62
+ .tree .toggle- button {
63
63
width :10px ;
64
64
height :10px ;
65
65
background : none ;
142
142
};
143
143
144
144
this .toggle = function (element ) {
145
+ var r;
146
+
145
147
if (element .style .display !== ' none' ) {
146
- this .collapse (element);
148
+ // this.collapse(element);
147
149
148
- return ' collapse' ;
150
+ r = ' collapse' ;
151
+ } else {
152
+ // this.expand(element);
149
153
}
150
154
151
- this .expand (element);
155
+ var imgs = element .parentElement .getElementsByTagName (' img' );
156
+ Sfjs .toggle (element, imgs[0 ], imgs[1 ]);
152
157
153
- return ' expand' ;
158
+ return r || ' expand' ;
154
159
}
155
160
}
156
161
160
165
treeView .collapseAll ();
161
166
treeView .expand (document .querySelector (' .tree ul ul' ));
162
167
163
- var buttons = tree .querySelectorAll (' button' );
168
+ var buttons = tree .querySelectorAll (' .toggle- button' );
164
169
for (var j = 0 , l = buttons .length ; j < l; j++ ) {
165
170
buttons[j].addEventListener (' click' , function (e ) {
166
171
if (' collapse' === treeView .toggle (this .parentElement .parentElement .querySelector (' ul' ))) {
238
243
<li >
239
244
<div class =" tree-inner" data-target-id =" {{ data .id }}" >
240
245
{% if data .children is not empty %}
241
- <button >+</button >
246
+ <img class =" toggle-button" style =" display:inline;" src =" {{ asset(' bundles/framework/images/blue_picto_more.gif' ) }}" >
247
+ <img class =" toggle-button" style =" display:none;" src =" {{ asset(' bundles/framework/images/blue_picto_less.gif' ) }}" >
248
+ {% else %}
249
+ <img class =" toggle-button" src =" {{ asset(' bundles/framework/images/blue_picto_full.gif' ) }}" >
242
250
{% endif %}
243
251
{{ name }}
244
252
</div >
Original file line number Diff line number Diff line change 86
86
var i,
87
87
style,
88
88
tmp = elOn .style .display ,
89
- el = document .getElementById (selector);
89
+ el = selector . nodeName ? selector : document .getElementById (selector);
90
90
91
91
elOn .style .display = elOff .style .display ;
92
92
elOff .style .display = tmp;
You can’t perform that action at this time.
0 commit comments