apps-menu: Minor code cleanup

The parameter to _clearApplicationBox() has never been used, so
remove it. In fact, modern javascript makes the function so compact
that we can just move the code inline.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/27
This commit is contained in:
Florian Müllner
2017-10-13 01:20:17 +02:00
parent 077a292952
commit d86044f383

View File

@@ -712,19 +712,10 @@ const ApplicationsButton = new Lang.Class({
this.mainBox.style+=('height: ' + height);
},
_clearApplicationsBox: function(selectedActor) {
let actors = this.applicationsBox.get_children();
for (let i = 0; i < actors.length; i++) {
let actor = actors[i];
this.applicationsBox.remove_actor(actor);
}
},
selectCategory: function(dir, categoryMenuItem) {
if (categoryMenuItem)
this._clearApplicationsBox(categoryMenuItem.actor);
else
this._clearApplicationsBox(null);
this.applicationsBox.get_children().forEach(c => {
this.applicationsBox.remove_actor(c);
});
if (dir)
this._displayButtons(this._listApplications(dir.get_menu_id()));