roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ghu...@apache.org
Subject svn commit: r1570521 - in /roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui: core/util/menu/MenuHelper.java rendering/model/MenuModel.java
Date Fri, 21 Feb 2014 10:45:52 GMT
Author: ghuber
Date: Fri Feb 21 10:45:51 2014
New Revision: 1570521

URL: http://svn.apache.org/r1570521
Log:
Menu speedup, make sure we allow no currentAction to be used (used in macros).

Modified:
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/util/menu/MenuHelper.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/MenuModel.java

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/util/menu/MenuHelper.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/util/menu/MenuHelper.java?rev=1570521&r1=1570520&r2=1570521&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/util/menu/MenuHelper.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/util/menu/MenuHelper.java
Fri Feb 21 10:45:51 2014
@@ -89,7 +89,7 @@ public class MenuHelper {
      * @param menuId
      *            the menu id
      * @param currentAction
-     *            the current action
+     *            the current action. Null to ignore.
      * @param user
      *            the user
      * @param weblog
@@ -212,7 +212,7 @@ public class MenuHelper {
 
                     boolean includeItem = true;
 
-                    if (!item.contains(currentAction)) {
+                    if (currentAction != null && !item.contains(currentAction)) {
                         // includeItem = false;
                         // Set first action on menu
                         // if (firstItem) {
@@ -267,7 +267,7 @@ public class MenuHelper {
 
                         // is this the selected item? Only one can be selected
                         // so skip the rest
-                        if (selectable
+                        if (currentAction != null && selectable
                                 && isSelected(currentAction, configTabItem)) {
                             tabItem.setSelected(true);
                             tab.setSelected(true);

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/MenuModel.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/MenuModel.java?rev=1570521&r1=1570520&r2=1570521&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/MenuModel.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/MenuModel.java
Fri Feb 21 10:45:51 2014
@@ -95,7 +95,7 @@ public class MenuModel implements Model 
      */
     public Menu getAuthorMenu() {
         if(pageRequest.isLoggedIn()) {
-            return MenuHelper.getMenu("editor", "noAction", pageRequest.getUser(), pageRequest.getWeblog());
+            return MenuHelper.getMenu("editor", null, pageRequest.getUser(), pageRequest.getWeblog());
         }
         return null;
     }



Mime
View raw message