From d86044f383b286cb58709736550a94e880998215 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 13 Oct 2017 01:20:17 +0200 Subject: [PATCH] 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 --- extensions/apps-menu/extension.js | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js index 600eda3d..8138d4ca 100644 --- a/extensions/apps-menu/extension.js +++ b/extensions/apps-menu/extension.js @@ -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()));