You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by id...@apache.org on 2007/05/03 11:57:59 UTC

svn commit: r534772 - in /myfaces/tobago/trunk/theme: scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/ scar...

Author: idus
Date: Thu May  3 02:57:59 2007
New Revision: 534772

URL: http://svn.apache.org/viewvc?view=rev&rev=534772
Log:
menu separators can have a different height than normal items now; TOBAGO-284

Modified:
    myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MenuBarRenderer.java
    myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/tobago-menu.js
    myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/tobago-menu.css
    myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/script/tobago-menu.js
    myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/style/tobago-menu.css

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MenuBarRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MenuBarRenderer.java?view=diff&rev=534772&r1=534771&r2=534772
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MenuBarRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MenuBarRenderer.java Thu May  3 02:57:59 2007
@@ -530,6 +530,8 @@
     sb.append("null");
     sb.append(", ");
     sb.append("true");
+    sb.append(", ");
+    sb.append("true");
     sb.append("));\n");
   }
 

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/tobago-menu.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/tobago-menu.js?view=diff&rev=534772&r1=534771&r2=534772
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/tobago-menu.js (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/tobago-menu.js Thu May  3 02:57:59 2007
@@ -91,12 +91,12 @@
   return menu;
 }
 
-Tobago.Menu.Item = function(label, action, disabled) {
+Tobago.Menu.Item = function(label, action, disabled, separator) {
   this.label = label;
   this.action = action;
   this.disabled = disabled;
   this.subItems = new Array();
-
+  this.separator = separator;
 };
 
 Tobago.Menu.Item.prototype.addMenuItem = function(menuItem) {
@@ -121,9 +121,11 @@
         onClick = ' onclick="tobagoMenuOpenMenu(this, event)"';
       }
 
-
-
-      html += '<div class="tobago-menu-item"'
+      var itemStyle = "tobago-menu-item";
+      if (this.separator) {
+        itemStyle += "-separator";
+      }
+      html += '<div class="' + itemStyle + '"'
           + ' id="' + this.id + '"';
       if (! this.disabled) {
         html += ' onmouseover="tobagoMenuItemOnmouseover(this)"'
@@ -620,8 +622,12 @@
   if (subItemContainer && menu.level != 0) {
     menu.subItemContainerStyleWidth
         = (menu.childWidth + getSubitemContainerBorderWidthSum()) + "px";
-    menu.subItemContainerStyleHeight = (menu.subItems.length  * getItemHeight()
-        + getSubitemContainerBorderWidthSum()) + "px";
+    var subMenuHeight = 0;
+    for (var i = 0; i < menu.subItems.length; ++i) {
+      var item = menu.subItems[i];
+      subMenuHeight += (item.separator ? getSeparatorHeight() : getItemHeight());
+    }
+    menu.subItemContainerStyleHeight = (subMenuHeight + getSubitemContainerBorderWidthSum()) + "px";
 
     subItemContainer.style.width = "0px";
     subItemContainer.style.height = "0px";
@@ -666,7 +672,11 @@
         htmlElement.style.zIndex = "999";
       }
       else { // level not 0 or 1
-        var top = (menu.index * getItemHeight());
+        var top = 0;
+        for (var i = 0; i < menu.index; ++i) {
+          var item = menu.parent.subItems[i];
+          top += (item.separator ? getSeparatorHeight() : getItemHeight());
+        }
         var left = 0;
         if (menu.level == 2 && menu.parent.parent.popup) {
           if (menu.parent.parent.popup == "ToolbarButton") {
@@ -793,6 +803,10 @@
   else {
     return 20;
   }
+}
+
+function getSeparatorHeight() {
+  return 20;
 }
 
 function getMenuArrowWidth() {

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/tobago-menu.css
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/tobago-menu.css?view=diff&rev=534772&r1=534771&r2=534772
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/tobago-menu.css (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/tobago-menu.css Thu May  3 02:57:59 2007
@@ -72,7 +72,7 @@
 
 }
 
-.tobago-menu-item {
+.tobago-menu-item, .tobago-menu-item-separator {
   visibility: inherit;
   overflow: auto; /* this MUST be auto (is needed and overwritten in javascript ) */
   height: 20px;

Modified: myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/script/tobago-menu.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/script/tobago-menu.js?view=diff&rev=534772&r1=534771&r2=534772
==============================================================================
--- myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/script/tobago-menu.js (original)
+++ myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/script/tobago-menu.js Thu May  3 02:57:59 2007
@@ -46,7 +46,9 @@
   }
 }
 
-
+function getSeparatorHeight() {
+  return 8;
+}
 
 function getPopupMenuWidth() {
   return 16;
@@ -64,7 +66,7 @@
     return "0px";
   }
   else {
-    LOG.debug("unbekanter Popup Typ :" + popup);
+    LOG.debug("unknown popup type: " + popup);
     return "0px";
   }
 }

Modified: myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/style/tobago-menu.css
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/style/tobago-menu.css?view=diff&rev=534772&r1=534771&r2=534772
==============================================================================
--- myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/style/tobago-menu.css (original)
+++ myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/style/tobago-menu.css Thu May  3 02:57:59 2007
@@ -44,6 +44,10 @@
   z-index: 1000;
 }
 
+.tobago-menu-item-separator {
+  height: 8px;
+  z-index: 1000;
+}
 
 .tobago-menu-item-hover {
   background: #bbbbbb;
@@ -59,7 +63,6 @@
 }
 
 .tobago-menuBar-item-span-enabled {
-
 }
 
 .tobago-menuBar-item-span-disabled {
@@ -92,10 +95,14 @@
   background: red;
 }
 
-.tobago-menuBar-separator  {
+.tobago-menuBar-separator {
   width: 100%;
   position: relative;
-  top: 9px;
+  top: 3px;
   left: -3px;
+  border-top: 1px solid #E2E2E2;
+  border-right: 1px solid #E2E2E2;
+  border-bottom: 1px solid gray;
+  border-left: 1px solid #E2E2E2;
 }