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 2007/02/22 22:23:22 UTC

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

Author: bommel
Date: Thu Feb 22 13:23:19 2007
New Revision: 510651

URL: http://svn.apache.org/viewvc?view=rev&rev=510651
Log:
(TOBAGO-121) made autoreload conditional with a valuebinding

Modified:
    myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/prototype.js
    myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js

Modified: myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/prototype.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/prototype.js?view=diff&rev=510651&r1=510650&r2=510651
==============================================================================
--- myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/prototype.js (original)
+++ myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/prototype.js Thu Feb 22 13:23:19 2007
@@ -463,7 +463,7 @@
     var result = this[0];
     for (var i = 0; i < this.length - 1; i++)
       this[i] = this[i + 1];
-    this.length--;
+    if (this.length > 0) {this.length--;} else {LOG.warn("Array.shift(): length < 1 ! ")}
     return result;
   },
 

Modified: myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js?view=diff&rev=510651&r1=510650&r2=510651
==============================================================================
--- myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js (original)
+++ myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js Thu Feb 22 13:23:19 2007
@@ -1107,7 +1107,11 @@
     */
   deleteOverlay: function(element) {
     var overlay = document.getElementById(element.id + "-overlay");
-    element.removeChild(overlay);
+    if (overlay && overlay.parentNode == element) {
+      element.removeChild(overlay);
+    } else {
+      LOG.warn("Can't find Overlay : \"" + element.id + "-overlay" + "\"");
+    }
     return element;
   },
 
@@ -1462,6 +1466,7 @@
 Tobago.Panel.prototype.reload = function(action, options) {
   //LOG.debug("reload panel with action \"" + action + "\"");
   var element = Tobago.element(this.id);
+  element.skipUpdate = false;
   var reloadOptions = Tobago.extend({}, this.options);
   reloadOptions = Tobago.extend(reloadOptions, options);
   Tobago.Updater.update(element, null, action, this.id, reloadOptions);
@@ -1682,8 +1687,7 @@
       //LOG.debug("this.CODE_NOT_MODIFIED = \"" + Tobago.Updater.CODE_NOT_MODIFIED + "\" ist lang:" + Tobago.Updater.CODE_NOT_MODIFIED.length);
       if (transport.status == 304) {
         LOG.debug("skip update response status 304");
-        Tobago.Transport.requestComplete();
-        Tobago.deleteOverlay(receiver);
+        receiver.skipUpdate = true;
       } else if (response.substring(0, Tobago.Updater.CODE_NOT_MODIFIED.length) == Tobago.Updater.CODE_NOT_MODIFIED) {
         // no update needed, do nothing
               LOG.debug("skip update");