File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -11,23 +11,28 @@ templates.resource_tree =
1111
1212 _init :function ( )
1313 {
14- this . _initialized = true ;
14+ if ( this . _initialized )
15+ return ;
16+
17+ // wrap the nesting templating for _depth iteration according styling
1518 [ 'document' , 'resource_group' , 'resource' ] . forEach ( function ( f )
1619 {
1720 var original = this [ f ] ;
1821 this [ f ] = function ( )
1922 {
2023 this . _depth ++ ;
2124
22- var r = original . apply ( this , arguments ) ;
23- if ( r && r [ 1 ] && r [ 1 ] [ 0 ] == 'h2' )
24- r [ 1 ] . push ( 'style' , 'padding-left:' + this . _depth * 18 + 'px;' ) ;
25+ var tpl = original . apply ( this , arguments ) ;
26+ if ( tpl && tpl [ 1 ] && tpl [ 1 ] [ 0 ] == 'h2' )
27+ tpl [ 1 ] . push ( 'style' , 'padding-left:' + this . _depth * 18 + 'px;' ) ;
2528
2629 this . _depth -- ;
27- return r ;
30+
31+ return tpl ;
2832 } ;
2933 } , this ) ;
3034
35+ this . _initialized = true ;
3136 } ,
3237
3338 expandCollapseToggle :function ( context , pivotID , tpl )
You can’t perform that action at this time.
0 commit comments