You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2010/08/13 22:36:07 UTC

svn commit: r985352 - /myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js

Author: bommel
Date: Fri Aug 13 20:36:07 2010
New Revision: 985352

URL: http://svn.apache.org/viewvc?rev=985352&view=rev
Log:
(TOBAGO-873) dblclick action for sheet

Modified:
    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-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=985352&r1=985351&r2=985352&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 Fri Aug 13 20:36:07 2010
@@ -433,7 +433,7 @@ Tobago.Sheet.prototype.addSelectionListe
     var row = this;
     Tobago.addBindEventListener(row, "mousedown", currentSheet, "doMouseDownSelect");
     Tobago.addBindEventListener(row, "click", currentSheet, "doSelection");
-    if (this.dblClickActionId) {
+    if (currentSheet.dblClickActionId) {
       Tobago.addBindEventListener(row, "dblclick", currentSheet, "doDblClick");
     }
   });
@@ -527,13 +527,8 @@ Tobago.Sheet.prototype.doDblClick = func
     //LOG.debug("Actionid " + this.clickActionId);
     //LOG.debug("ID " + this.id);
     if (! Tobago.isInputElement(srcElement.tagName)) {
-      var dataRow = Tobago.element(event);
-      while (dataRow.id.search(new RegExp("_data_tr_\\d+$")) == -1) {
-        dataRow = dataRow.parentNode;
-      }
-      var rowId = dataRow.id;
-      //LOG.debug("rowId = " + rowId);
-      var rowIndex = rowId.substring(rowId.lastIndexOf("_data_tr_") + 9);
+      var row = jQuery(Tobago.element(event)).closest("tr");
+      var rowIndex = row.index() + this.firstRowIndex;
       //LOG.debug("selected rows = " + hidden.value);
       if (this.dblClickActionId) {
         var action = this.id + ":" + rowIndex + ":" + this.dblClickActionId;