@@ -15,6 +15,7 @@ var ClassTree = function (parent, treeViewContainer) {
1515 this . SELECTED_TYPE = null ; // "class" || "package"
1616 this . SELECTED_ELEMENT = null ;
1717 this . SELECTED_LEVEL = null ;
18+ this . INCLUDE_MAPPED = this . cacheClassExplorer . elements . showMappedCheckbox . checked ;
1819 this . treeObject = null ;
1920 /**
2021 * @private
@@ -25,6 +26,10 @@ var ClassTree = function (parent, treeViewContainer) {
2526 this . cacheClassExplorer . elements . classTreeSearch . addEventListener ( "input" , function ( e ) {
2627 self . searchChanged . call ( self , ( e . target || e . srcElement ) . value ) ;
2728 } ) ;
29+ this . cacheClassExplorer . elements . showMappedCheckbox . addEventListener ( "change" , function ( ) {
30+ self . INCLUDE_MAPPED = self . cacheClassExplorer . elements . showMappedCheckbox . checked ;
31+ self . update ( ) ;
32+ } ) ;
2833
2934 window . addEventListener ( "resize" , function ( ) {
3035 self . updateSizes ( ) ;
@@ -34,6 +39,19 @@ var ClassTree = function (parent, treeViewContainer) {
3439
3540} ;
3641
42+ ClassTree . prototype . update = function ( ) {
43+
44+ var self = this ;
45+
46+ this . cacheClassExplorer . elements . classTreeSearch . value = "" ;
47+ this . container . textContent = "" ;
48+ this . showLoader ( ) ;
49+ this . cacheClassExplorer . source . getClassTree ( this . INCLUDE_MAPPED , function ( err , data ) {
50+ if ( ! err ) self . updateTree ( data ) ;
51+ } ) ;
52+
53+ } ;
54+
3755ClassTree . prototype . setSelectedClassList = function ( list ) {
3856
3957 // this enables saved view to be consistent for any class names order
@@ -70,7 +88,8 @@ ClassTree.prototype.removeLoader = function () {
7088 if ( ! this . loader ) return ;
7189
7290 this . cacheClassExplorer . elements . classTreeSearch . value = "" ;
73- this . loader . parentNode . removeChild ( this . loader ) ;
91+ if ( this . loader . parentNode )
92+ this . loader . parentNode . removeChild ( this . loader ) ;
7493 this . loader = null ;
7594
7695} ;
@@ -255,7 +274,7 @@ ClassTree.prototype.updateTree = function (treeObject, doNotChangeRoot) {
255274 arr = [ ] ;
256275
257276 for ( i in object ) {
258- arr . push ( { name : getRealName ( i ) , val : object [ i ] } ) ;
277+ arr . push ( { name : getRealName ( i ) , val : object [ i ] , isPackage : i [ 0 ] === "/" } ) ;
259278 }
260279
261280 arr . sort ( function ( a , b ) {
@@ -268,7 +287,7 @@ ClassTree.prototype.updateTree = function (treeObject, doNotChangeRoot) {
268287 if ( rec = append (
269288 rootElement ,
270289 element . name ,
271- typeof element . val === "object" ,
290+ element . isPackage ,
272291 path . join ( "." ) ,
273292 level
274293 ) ) {
@@ -282,4 +301,8 @@ ClassTree.prototype.updateTree = function (treeObject, doNotChangeRoot) {
282301
283302 if ( ! doNotChangeRoot ) this . treeObject = treeObject ;
284303
304+ } ;
305+
306+ ClassTree . prototype . init = function ( ) {
307+ this . update ( ) ;
285308} ;
0 commit comments