From ff3c20dda2ee3f9d8eac52ec0b52ca7fbdb0caee Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Fri, 10 May 2013 11:17:16 -0400 Subject: [PATCH] remoteMenu: Minor code cleanups https://bugzilla.gnome.org/show_bug.cgi?id=700257 --- js/ui/remoteMenu.js | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/js/ui/remoteMenu.js b/js/ui/remoteMenu.js index 144dbdb62..cd3f36ac3 100644 --- a/js/ui/remoteMenu.js +++ b/js/ui/remoteMenu.js @@ -20,19 +20,16 @@ function stripMnemonics(label) { } function _insertItem(menu, trackerItem, position) { - let item; + let mapper; - if (trackerItem.get_is_separator()) { - let mapper = new RemoteMenuSeparatorItemMapper(trackerItem); - item = mapper.menuItem; - } else if (trackerItem.get_has_submenu()) { - let mapper = new RemoteMenuSubmenuItemMapper(trackerItem); - item = mapper.menuItem; - } else { - let mapper = new RemoteMenuItemMapper(trackerItem); - item = mapper.menuItem; - } + if (trackerItem.get_is_separator()) + mapper = new RemoteMenuSeparatorItemMapper(trackerItem); + else if (trackerItem.get_has_submenu()) + mapper = new RemoteMenuSubmenuItemMapper(trackerItem); + else + mapper = new RemoteMenuItemMapper(trackerItem); + let item = mapper.menuItem; menu.addMenuItem(item, position); }