[gnome-shell/wip/gtkmenutrackeritem: 32/32] remoteMenu: Minor code cleanups



commit a26e0a336efb367708d89dbee099a26968f92943
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri May 10 11:17:16 2013 -0400

    remoteMenu: Minor code cleanups

 js/ui/remoteMenu.js |   19 ++++++++-----------
 1 files changed, 8 insertions(+), 11 deletions(-)
---
diff --git a/js/ui/remoteMenu.js b/js/ui/remoteMenu.js
index b258f0f..7680c75 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;
-
-    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;
-    }
+    let mapper;
 
+    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);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]