@@ -252,19 +252,17 @@ define([
252
252
isMediaBrowser = ! _ . isUndefined ( window . MediabrowserUtility ) ,
253
253
currentTreePath ;
254
254
255
- currentTreePath = this . isFiltersApplied ( currentFilterPath ) || ! isMediaBrowser ? currentFilterPath :
256
- Base64 . idDecode ( window . MediabrowserUtility . pathId ) ;
257
-
258
- if ( this . folderExistsInTree ( currentTreePath ) ) {
259
- this . locateNode ( currentTreePath ) ;
255
+ if ( _ . isUndefined ( currentFilterPath ) ) {
256
+ this . clearFiltersHandle ( ) ;
260
257
} else {
261
- this . selectStorageRoot ( ) ;
262
- }
258
+ currentTreePath = this . isFiltersApplied ( currentFilterPath ) || ! isMediaBrowser ? currentFilterPath :
259
+ Base64 . idDecode ( window . MediabrowserUtility . pathId ) ;
263
260
264
- if ( _ . isUndefined ( currentFilterPath ) ) {
265
- $ ( this . directoryTreeSelector ) . jstree ( 'deselect_all' ) ;
266
- this . activeNode ( null ) ;
267
- this . directories ( ) . setInActive ( ) ;
261
+ if ( this . folderExistsInTree ( currentTreePath ) ) {
262
+ this . locateNode ( currentTreePath ) ;
263
+ } else {
264
+ this . selectStorageRoot ( ) ;
265
+ }
268
266
}
269
267
} ,
270
268
@@ -287,7 +285,8 @@ define([
287
285
* @param {String } currentFilterPath
288
286
*/
289
287
isFiltersApplied : function ( currentFilterPath ) {
290
- return ! _ . isUndefined ( currentFilterPath ) ;
288
+ return ! _ . isUndefined ( currentFilterPath ) && currentFilterPath !== ''
289
+ && currentFilterPath !== 'catalog/category' ;
291
290
} ,
292
291
293
292
/**
@@ -307,6 +306,12 @@ define([
307
306
308
307
} ,
309
308
309
+ clearFiltersHandle : function ( ) {
310
+ $ ( this . directoryTreeSelector ) . jstree ( 'deselect_all' ) ;
311
+ this . activeNode ( null ) ;
312
+ this . directories ( ) . setInActive ( ) ;
313
+ } ,
314
+
310
315
/**
311
316
* Set active node filter, or deselect if the same node clicked
312
317
*
0 commit comments