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 2008/07/02 15:35:03 UTC

svn commit: r673388 - /myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js

Author: idus
Date: Wed Jul  2 06:35:02 2008
New Revision: 673388

URL: http://svn.apache.org/viewvc?rev=673388&view=rev
Log:
TOBAGO-630: Made access to image source attributes safer

Modified:
    myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js

Modified: myfaces/tobago/branches/tobago-1.0.x/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/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js?rev=673388&r1=673387&r2=673388&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js (original)
+++ myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js Wed Jul  2 06:35:02 2008
@@ -590,7 +590,7 @@
 
       Tobago.removeCssClass(row, "tobago-sheet-row-selected");
 
-      if (image && !image.src.match(/Disabled/)) {
+      if (image && image.src && !image.src.match(/Disabled/)) {
         image.src = this.uncheckedImage;
       }
 
@@ -598,7 +598,7 @@
       if (classes.search(/tobago-sheet-row-selected/) == -1) {
         Tobago.addCssClass(row, "tobago-sheet-row-selected");
       }
-      if (image && !image.src.match(/Disabled/)) {
+      if (image && image.src && !image.src.match(/Disabled/)) {
         image.src = this.checkedImage;
       }
     }
@@ -614,7 +614,7 @@
 Tobago.Sheet.prototype.toggleSelection = function(rowIndex) {
     this.tobagoLastClickedRowId = Tobago.element(this.id + "_data_tr_" + rowIndex).id;
     var selector = Tobago.element(this.id + "_data_row_selector_" + rowIndex);
-    if (!selector || !selector.src.match(/Disabled/)) {
+    if (!selector || !selector.src || !selector.src.match(/Disabled/)) {
       var re = new RegExp("," + rowIndex + ",");
       var selected = Tobago.element(this.selectedId);
       if (selected.value.search(re) != -1) {
@@ -645,7 +645,7 @@
       var re = new RegExp("," + i + ",");
       if (selected.value.search(re) == -1) {
         var selector = Tobago.element(this.id + "_data_row_selector_" + i);
-        if (!selector || !selector.src.match(/Disabled/)) {
+        if (!selector || !selector.src || !selector.src.match(/Disabled/)) {
           selected.value = selected.value + i + ",";
         }
       }
@@ -834,7 +834,7 @@
     var selected = Tobago.element(this.selectedId);
     while (row) {
       var image = this.getSelectionElementForRow(row);
-      if (!image || !image.src.match(/Disabled/)) {
+      if (!image || !image.src || !image.src.match(/Disabled/)) {
         var re = new RegExp("," + i + ",");
         if (selected.value.search(re) == -1) {
           selected.value = selected.value + i + ",";
@@ -855,7 +855,7 @@
       var j = 0;
       while (row) {
         image = this.getSelectionElementForRow(row);
-        if (!image || !image.src.match(/Disabled/)) {
+        if (!image || !image.src || !image.src.match(/Disabled/)) {
           var re = new RegExp("," + i + ",", 'g');
           selected.value = selected.value.replace(re, ",");
         }