File tree Expand file tree Collapse file tree 3 files changed +16
-8
lines changed
FrameworkBundle/Resources/public/images
WebProfilerBundle/Resources/views Expand file tree Collapse file tree 3 files changed +16
-8
lines changed Original file line number Diff line number Diff line change 5959 .tree a {
6060 text-decoration : none ;
6161 }
62- .tree button {
62+ .tree .toggle- button {
6363 width :10px ;
6464 height :10px ;
6565 background : none ;
142142 };
143143
144144 this .toggle = function (element ) {
145+ var r;
146+
145147 if (element .style .display !== ' none' ) {
146- this .collapse (element);
148+ // this.collapse(element);
147149
148- return ' collapse' ;
150+ r = ' collapse' ;
151+ } else {
152+ // this.expand(element);
149153 }
150154
151- this .expand (element);
155+ var imgs = element .parentElement .getElementsByTagName (' img' );
156+ Sfjs .toggle (element, imgs[0 ], imgs[1 ]);
152157
153- return ' expand' ;
158+ return r || ' expand' ;
154159 }
155160 }
156161
160165 treeView .collapseAll ();
161166 treeView .expand (document .querySelector (' .tree ul ul' ));
162167
163- var buttons = tree .querySelectorAll (' button' );
168+ var buttons = tree .querySelectorAll (' .toggle- button' );
164169 for (var j = 0 , l = buttons .length ; j < l; j++ ) {
165170 buttons[j].addEventListener (' click' , function (e ) {
166171 if (' collapse' === treeView .toggle (this .parentElement .parentElement .querySelector (' ul' ))) {
238243 <li >
239244 <div class =" tree-inner" data-target-id =" {{ data .id }}" >
240245 {% 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' ) }}" >
242250 {% endif %}
243251 {{ name }}
244252 </div >
Original file line number Diff line number Diff line change 8686 var i,
8787 style,
8888 tmp = elOn .style .display ,
89- el = document .getElementById (selector);
89+ el = selector . nodeName ? selector : document .getElementById (selector);
9090
9191 elOn .style .display = elOff .style .display ;
9292 elOff .style .display = tmp;
You can’t perform that action at this time.
0 commit comments