@@ -152,24 +152,41 @@ CacheClassExplorer.prototype.setNamespace = function (namespace) {
152152 var self = this ;
153153
154154 this . NAMESPACE = namespace ;
155+ this . classTree . setSelectedClassList ( [ ] ) ;
155156
156157 self . classTree . container . textContent = "" ;
157158 self . classTree . showLoader ( ) ;
158159 this . source . getClassTree ( function ( err , data ) {
159160 if ( ! err ) self . classTree . updateTree ( data ) ;
160161 } ) ;
161162
163+ this . updateNamespace ( ) ;
164+ this . updateURL ( ) ;
165+
166+ } ;
167+
168+ /**
169+ * Updates namespace UI.
170+ */
171+ CacheClassExplorer . prototype . updateNamespace = function ( ) {
172+
173+ this . elements . namespaces . value = this . NAMESPACE ;
174+
162175} ;
163176
164177CacheClassExplorer . prototype . updateURL = function ( ) {
165178
166179 var obj = {
167- name : this . classTree . SELECTED_NAME ,
168- type : this . classTree . SELECTED_TYPE ,
169- level : this . classTree . SELECTED_LEVEL
180+ name : this . classTree . SELECTED_NAME
170181 } ;
182+
183+ if ( this . classTree . SELECTED_TYPE !== null )
184+ obj . type = this . classTree . SELECTED_TYPE ;
185+ if ( this . classTree . SELECTED_LEVEL !== null )
186+ obj . level = this . classTree . SELECTED_LEVEL ;
171187
172- if ( this . NAMESPACE ) obj [ "namespace" ] = this . NAMESPACE ;
188+ if ( this . NAMESPACE )
189+ obj [ "namespace" ] = this . NAMESPACE ;
173190
174191 location . hash = JSON . stringify ( obj ) ;
175192
@@ -182,11 +199,13 @@ CacheClassExplorer.prototype.restoreFromURL = function () {
182199
183200 try { obj = JSON . parse ( hash ) ; } catch ( e ) { obj = { } ; }
184201
185- if ( obj . level ) {
202+ if ( obj . level )
186203 this . classTree . SELECTED_LEVEL = obj . level ;
204+ if ( obj . namespace ) {
205+ this . NAMESPACE = obj . namespace ;
206+ this . updateNamespace ( ) ;
187207 }
188208
189- if ( obj . namespace ) this . NAMESPACE = obj . namespace ;
190209 if ( obj . type === "class" ) { // left for older Class Explorer versions support
191210 this . classView . loadClasses ( [ obj . name ] , true ) ;
192211 } else if ( obj . type === "package" ) {
0 commit comments