[Jifty-commit] r7377 - jifty/trunk/share/web/static/js

Jifty commits jifty-commit at lists.jifty.org
Thu Aug 13 21:36:06 EDT 2009


Author: sartak
Date: Thu Aug 13 21:36:06 2009
New Revision: 7377

Modified:
   jifty/trunk/share/web/static/js/jifty.js

Log:
If we're preloading, bail out early

Modified: jifty/trunk/share/web/static/js/jifty.js
==============================================================================
--- jifty/trunk/share/web/static/js/jifty.js	(original)
+++ jifty/trunk/share/web/static/js/jifty.js	Thu Aug 13 21:36:06 2009
@@ -1306,11 +1306,15 @@
     // NOTE: Success here doesn't mean the server liked the request, but that
     // the HTTP communication succeeded. There still might be errors validating
     // fields, with the app connecting to the database, etc.
-    var onSuccess = function(responseXML, object) {
+    var onSuccess = function(responseXML, preload) {
 
         // Grab the XML response
         var response = responseXML.documentElement;
 
+        if (preload) {
+            return;
+        }
+
         /* var response is an xml , which's content is like:
         <response>
             <fragment id="__page-region-name">
@@ -1485,10 +1489,17 @@
         error:       onFailure,
 
         // Hide the wait message when we're done
-        complete:    function(){if (!hide_wait) { hide_wait_message() }},
-        success:     onSuccess,
+        complete: function() {
+            if (!hide_wait) {
+                hide_wait_message();
+            }
+        },
+
+        success: function(responseXML) {
+            onSuccess(responseXML, named_args['preload']);
+        },
 
-        beforeSend:  function (request) {
+        beforeSend: function (request) {
             var headers = named_args['headers'];
             for (header in headers) {
                 if (headers.hasOwnProperty(header)) {


More information about the Jifty-commit mailing list