You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2014/07/09 16:05:40 UTC
svn commit: r1609160 - in
/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main:
java/org/apache/myfaces/tobago/renderkit/html/util/
resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/
Author: lofwyr
Date: Wed Jul 9 14:05:39 2014
New Revision: 1609160
URL: http://svn.apache.org/r1609160
Log:
TOBAGO-1410: Menu Dropdown did not collapse after partially action
Modified:
myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/util/HtmlRendererUtils.java
myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-menu.js
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/util/HtmlRendererUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/util/HtmlRendererUtils.java?rev=1609160&r1=1609159&r2=1609160&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/util/HtmlRendererUtils.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/util/HtmlRendererUtils.java Wed Jul 9 14:05:39 2014
@@ -120,11 +120,10 @@ public final class HtmlRendererUtils {
final UIPage page = (UIPage) ComponentUtils.findPage(facesContext, component);
final String id = component.getClientId(facesContext);
if (!StringUtils.isBlank(page.getFocusId()) && !page.getFocusId().equals(id)) {
- LOG.warn("page focusId = \"" + page.getFocusId() + "\" ignoring new value \""
- + id + "\"");
+ LOG.warn("page focusId='" + page.getFocusId() + "' ignoring new value '" + id + "'");
} else {
final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
- writer.writeJavascript("Tobago.focusId = '" + id + "';");
+ writer.writeJavascript("Tobago.focusId='" + id + "';");
}
}
}
@@ -482,61 +481,11 @@ public final class HtmlRendererUtils {
}
return clientId;
}
- LOG.error("No Component found for id " + componentId + " search base component " + component.getClientId(context));
+ LOG.error("No component found for id='" + componentId + "', " +
+ "search base component is '" + component.getClientId(context) + "'");
return null;
}
- /**
- * @deprecated since Tobago 1.5.0.
- */
- @Deprecated
- public static String toStyleString(final String key, final Integer value) {
- final StringBuilder buf = new StringBuilder();
- buf.append(key);
- buf.append(":");
- buf.append(value);
- buf.append("px; ");
- return buf.toString();
- }
-
- /**
- * @deprecated since Tobago 1.5.0.
- */
- @Deprecated
- public static String toStyleString(final String key, final String value) {
- final StringBuilder buf = new StringBuilder();
- buf.append(key);
- buf.append(":");
- buf.append(value);
- buf.append("; ");
- return buf.toString();
- }
-
- /**
- * @deprecated since Tobago 1.5.0. Please use getTitleFromTipAndMessages and write it out.
- */
- @Deprecated
- public static void renderTip(final UIComponent component, final TobagoResponseWriter writer) throws IOException {
- final Object objTip = component.getAttributes().get(Attributes.TIP);
- if (objTip != null) {
- final String tip = String.valueOf(objTip);
- writer.writeAttribute(HtmlAttributes.TITLE, tip, true);
- }
- }
-
- /**
- * @deprecated since Tobago 1.5.0. Please use getTitleFromTipAndMessages and write it out.
- */
- public static void renderImageTip(final UIComponent component, final TobagoResponseWriter writer) throws IOException {
- final Object objTip = component.getAttributes().get(Attributes.TIP);
- if (objTip != null) {
- final String tip = String.valueOf(objTip);
- writer.writeAttribute(HtmlAttributes.ALT, tip, true);
- } else {
- writer.writeAttribute(HtmlAttributes.ALT, "", false);
- }
- }
-
public static String getJavascriptString(final String str) {
if (str != null) {
return "\"" + str + "\"";
@@ -848,14 +797,6 @@ public final class HtmlRendererUtils {
return builder.toString();
}
- /**
- * @deprecated since Tobago 1.5.0. Please use {@link org.apache.myfaces.tobago.renderkit.css.Classes}.
- */
- @Deprecated
- public static void removeStyleClasses(final UIComponent cell) {
- Deprecation.LOG.warn("cell = '" + cell + "'");
- }
-
public static void encodeContextMenu(
final FacesContext facesContext, final TobagoResponseWriter writer, final UIComponent parent)
throws IOException {
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-menu.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-menu.js?rev=1609160&r1=1609159&r2=1609160&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-menu.js (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-menu.js Wed Jul 9 14:05:39 2014
@@ -388,7 +388,7 @@ Tobago.Menu.init = function(elements) {
});
// prevent default
- var menu = Tobago.Utils.selectWidthJQuery(elements, ".tobago-menu");
+ var menu = Tobago.Utils.selectWidthJQuery(elements, ".tobago-menu").not(".tobago-menu-markup-top");
menu.each(function() {
var menuItem = jQuery(this);
if (menuItem.children("ol").size() > 0) {
@@ -397,6 +397,10 @@ Tobago.Menu.init = function(elements) {
event.preventDefault();
return false;
});
+ } else {
+ menuItem.click(function(event) {
+ Tobago.Menu.closeAll();
+ });
}
});
};