[Jifty-commit] jifty branch, jifty_client, updated. 27913d35c2b97b03312b9ab1c012cdb1cb65f875

Jifty commits jifty-commit at lists.jifty.org
Sun May 2 08:42:04 EDT 2010


The branch, jifty_client has been updated
       via  27913d35c2b97b03312b9ab1c012cdb1cb65f875 (commit)
      from  0765dff991ba89e190d110ceb961f6d06d1c35d0 (commit)

Summary of changes:
 share/web/static/js/jifty_client.js |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

- Log -----------------------------------------------------------------
commit 27913d35c2b97b03312b9ab1c012cdb1cb65f875
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Sun May 2 20:42:03 2010 +0800

    If we run an Update action we report spurious failure

diff --git a/share/web/static/js/jifty_client.js b/share/web/static/js/jifty_client.js
index b9c7537..cb16905 100644
--- a/share/web/static/js/jifty_client.js
+++ b/share/web/static/js/jifty_client.js
@@ -76,11 +76,14 @@ Class("JiftyClient", {
             // if the action returns failure then we want to run the onFailure
             // handler, even though the AJAX request was successful
             var onAjaxSuccess = function (result) {
-                if (result.success) {
-                    onSuccess(result);
+                // on an Update action, we are redirected to a GET of the object
+                // which will (probably..) not have a success field. argh. is
+                // there anything better we can do here?
+                if (result.success === 0) {
+                    onFailure(result);
                 }
                 else {
-                    onFailure(result);
+                    onSuccess(result);
                 }
             };
 

-----------------------------------------------------------------------


More information about the Jifty-commit mailing list