[Jifty-commit] jifty branch, jifty_client, updated. b0fdd7827bbf387d408be7587e43251424e169ce

Jifty commits jifty-commit at lists.jifty.org
Tue May 4 05:57:19 EDT 2010


The branch, jifty_client has been updated
       via  b0fdd7827bbf387d408be7587e43251424e169ce (commit)
      from  9865074d2b7b1f79719ff9f444aa8d251251144b (commit)

Summary of changes:
 share/web/static/js/jifty_client.js |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

- Log -----------------------------------------------------------------
commit b0fdd7827bbf387d408be7587e43251424e169ce
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue May 4 17:57:23 2010 +0800

    Add an eachColumn(callback) to JiftyModel

diff --git a/share/web/static/js/jifty_client.js b/share/web/static/js/jifty_client.js
index 689f6c0..968ceaf 100644
--- a/share/web/static/js/jifty_client.js
+++ b/share/web/static/js/jifty_client.js
@@ -24,11 +24,9 @@ Class("JiftyModel", {
                 console.log("This record seems to have no _original field; unable to compute diff.", record);
             }
 
-            Joose.O.eachSafe(this.meta.getAttributes(), function (attr, name) {
-                if (attr.getProps().jiftyColumn) {
-                    if (record[name] != original[name]) {
-                        diff[name] = record[name];
-                    }
+            this.meta.getClassObject().eachColumn(function (column, name) {
+                if (record[name] != original[name]) {
+                    diff[name] = record[name];
                 }
             });
 
@@ -51,6 +49,14 @@ Class("JiftyModel", {
             };
 
             jiftyClient.fetchRecord(className, id, onAjaxSuccess, onFailure);
+        },
+        eachColumn: function (callback) {
+            Joose.O.eachSafe(this.meta.getAttributes(), function (attr, name) {
+                if (attr.getProps().jiftyColumn) {
+                    callback(attr, name);
+                }
+            });
+
         }
     }
 });

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


More information about the Jifty-commit mailing list