Permalink
Browse files

Show applications from subcategories in their parent category

  • Loading branch information...
1 parent 16da744 commit 243594d9b777bddd9bb2d8e7ab08c06673394e01 @glebihan glebihan committed Dec 15, 2011
Showing with 5 additions and 4 deletions.
  1. +5 −4 js/ui/mintMenu.js
View
@@ -444,19 +444,20 @@ ApplicationsButton.prototype = {
this._display();
},
- _loadCategory: function(dir) {
+ _loadCategory: function(dir, top_dir) {
var iter = dir.iter();
var nextType;
+ if (!top_dir) top_dir = dir;
while ((nextType = iter.next()) != GMenu.TreeItemType.INVALID) {
if (nextType == GMenu.TreeItemType.ENTRY) {
var entry = iter.get_entry();
if (!entry.get_app_info().get_nodisplay()) {
var app = appsys.lookup_app_by_tree_entry(entry);
- if (!this.applicationsByCategory[dir.get_menu_id()]) this.applicationsByCategory[dir.get_menu_id()] = new Array();
-this.applicationsByCategory[dir.get_menu_id()].push(app);
+ if (!this.applicationsByCategory[top_dir.get_menu_id()]) this.applicationsByCategory[top_dir.get_menu_id()] = new Array();
+this.applicationsByCategory[top_dir.get_menu_id()].push(app);
}
} else if (nextType == GMenu.TreeItemType.DIRECTORY) {
- this._loadCategory(iter.get_directory());
+ this._loadCategory(iter.get_directory(), top_dir);
}
}
},

0 comments on commit 243594d

Please sign in to comment.