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 2011/06/28 14:19:39 UTC
svn commit: r1140559 - in /myfaces/tobago/trunk/tobago-theme:
tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/
tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/st...
Author: lofwyr
Date: Tue Jun 28 12:19:39 2011
New Revision: 1140559
URL: http://svn.apache.org/viewvc?rev=1140559&view=rev
Log:
TOBAGO-1003: Clean up javascript for sheet
- disabled button should not get an event handler
Modified:
myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java
myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java?rev=1140559&r1=1140558&r2=1140559&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java Tue Jun 28 12:19:39 2011
@@ -47,6 +47,7 @@ import org.apache.myfaces.tobago.renderk
import org.apache.myfaces.tobago.renderkit.css.Classes;
import org.apache.myfaces.tobago.renderkit.css.Position;
import org.apache.myfaces.tobago.renderkit.css.Style;
+import org.apache.myfaces.tobago.renderkit.html.DataAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
@@ -710,6 +711,9 @@ public class SheetRenderer extends Layou
writer.writeAttribute(HtmlAttributes.SRC, image, false);
writer.writeAttribute(HtmlAttributes.TITLE, tip, true);
writer.writeAttribute(HtmlAttributes.ALT, "", false);
+ if (disabled) {
+ writer.writeAttribute(DataAttributes.DISABLED, Boolean.TRUE.toString(), false);
+ }
writer.endElement(HtmlElements.IMG);
}
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js?rev=1140559&r1=1140558&r2=1140559&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js Tue Jun 28 12:19:39 2011
@@ -117,7 +117,9 @@ Tobago.Sheet.prototype.setupPagePaging =
var child = linkBox.childNodes[i];
if (child.nodeType == 1 && child.tagName.toUpperCase() == "IMG") {
// first, prev, next and last commands
- Tobago.addBindEventListener(child, "click", this, "doPaging");
+ if ("true" != jQuery(child).attr("data-tobago-disabled")) {
+ Tobago.addBindEventListener(child, "click", this, "doPaging");
+ }
} else if (child.nodeType == 1 && child.tagName.toUpperCase() == "SPAN") {
var toPageId = this.id + Tobago.COMPONENT_SEP + "ToPage";
Tobago.addEventListener(child, "click", Tobago.bind(this, "insertTarget", toPageId));