@@ -152,24 +152,41 @@ CacheClassExplorer.prototype.setNamespace = function (namespace) {
152
152
var self = this ;
153
153
154
154
this . NAMESPACE = namespace ;
155
+ this . classTree . setSelectedClassList ( [ ] ) ;
155
156
156
157
self . classTree . container . textContent = "" ;
157
158
self . classTree . showLoader ( ) ;
158
159
this . source . getClassTree ( function ( err , data ) {
159
160
if ( ! err ) self . classTree . updateTree ( data ) ;
160
161
} ) ;
161
162
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
+
162
175
} ;
163
176
164
177
CacheClassExplorer . prototype . updateURL = function ( ) {
165
178
166
179
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
170
181
} ;
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 ;
171
187
172
- if ( this . NAMESPACE ) obj [ "namespace" ] = this . NAMESPACE ;
188
+ if ( this . NAMESPACE )
189
+ obj [ "namespace" ] = this . NAMESPACE ;
173
190
174
191
location . hash = JSON . stringify ( obj ) ;
175
192
@@ -182,11 +199,13 @@ CacheClassExplorer.prototype.restoreFromURL = function () {
182
199
183
200
try { obj = JSON . parse ( hash ) ; } catch ( e ) { obj = { } ; }
184
201
185
- if ( obj . level ) {
202
+ if ( obj . level )
186
203
this . classTree . SELECTED_LEVEL = obj . level ;
204
+ if ( obj . namespace ) {
205
+ this . NAMESPACE = obj . namespace ;
206
+ this . updateNamespace ( ) ;
187
207
}
188
208
189
- if ( obj . namespace ) this . NAMESPACE = obj . namespace ;
190
209
if ( obj . type === "class" ) { // left for older Class Explorer versions support
191
210
this . classView . loadClasses ( [ obj . name ] , true ) ;
192
211
} else if ( obj . type === "package" ) {
0 commit comments