flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [2/2] git commit: [flex-asjs] [refs/heads/develop] - fix generic databinding
Date Fri, 01 May 2015 06:52:28 GMT
fix generic databinding


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/e9215c25
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/e9215c25
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/e9215c25

Branch: refs/heads/develop
Commit: e9215c2549668cd904794ef0ae39a426ba364e19
Parents: 80876eb
Author: Alex Harui <aharui@apache.org>
Authored: Thu Apr 30 23:51:38 2015 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Thu Apr 30 23:52:19 2015 -0700

----------------------------------------------------------------------
 .../as/src/org/apache/flex/binding/PropertyWatcher.as       | 2 +-
 .../as/src/org/apache/flex/binding/ViewBaseDataBinding.as   | 9 +++++++--
 .../src/org/apache/flex/binding/ApplicationDataBinding.as   | 9 +++++++--
 .../org/apache/flex/binding/MXMLBeadViewBaseDataBinding.as  | 9 +++++++--
 4 files changed, 22 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/e9215c25/frameworks/projects/Binding/as/src/org/apache/flex/binding/PropertyWatcher.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Binding/as/src/org/apache/flex/binding/PropertyWatcher.as
b/frameworks/projects/Binding/as/src/org/apache/flex/binding/PropertyWatcher.as
index 9f73139..01d9caf 100644
--- a/frameworks/projects/Binding/as/src/org/apache/flex/binding/PropertyWatcher.as
+++ b/frameworks/projects/Binding/as/src/org/apache/flex/binding/PropertyWatcher.as
@@ -142,7 +142,7 @@ package org.apache.flex.binding
             if (source && source is IEventDispatcher)
                 removeEventListeners();
 
-            if (source is PropertyWatcher)
+            if (parent is PropertyWatcher)
                 source = PropertyWatcher(parent).value;
             else
                 source = parent;

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/e9215c25/frameworks/projects/Binding/as/src/org/apache/flex/binding/ViewBaseDataBinding.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Binding/as/src/org/apache/flex/binding/ViewBaseDataBinding.as
b/frameworks/projects/Binding/as/src/org/apache/flex/binding/ViewBaseDataBinding.as
index 7505e53..960b2b5 100644
--- a/frameworks/projects/Binding/as/src/org/apache/flex/binding/ViewBaseDataBinding.as
+++ b/frameworks/projects/Binding/as/src/org/apache/flex/binding/ViewBaseDataBinding.as
@@ -184,7 +184,12 @@ package org.apache.flex.binding
             for (var i:int = 0; i < n; i++)
             {
                 var watcher:Object = watchers[i];
-                if (watcher.bindings.indexOf(index) != -1)
+                var isValidWatcher:Boolean = false;
+                if (typeof(watcher.bindings) == "number")
+                    isValidWatcher = (watcher.bindings == index);
+                else
+                    isValidWatcher = (watcher.bindings.indexOf(index) != -1);
+                if (isValidWatcher)
                 {
                     var type:String = watcher.type;
                     switch (type)
@@ -209,7 +214,7 @@ package org.apache.flex.binding
                     }
                     if (watcher.children)
                     {
-                        setupWatchers(gb, index, watcher.children, watcher.watcher);
+                        setupWatchers(gb, index, watcher.children.watchers, watcher.watcher);
                     }
                 }
             }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/e9215c25/frameworks/projects/Binding/asjs/src/org/apache/flex/binding/ApplicationDataBinding.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Binding/asjs/src/org/apache/flex/binding/ApplicationDataBinding.as
b/frameworks/projects/Binding/asjs/src/org/apache/flex/binding/ApplicationDataBinding.as
index e752cc0..e4379bd 100644
--- a/frameworks/projects/Binding/asjs/src/org/apache/flex/binding/ApplicationDataBinding.as
+++ b/frameworks/projects/Binding/asjs/src/org/apache/flex/binding/ApplicationDataBinding.as
@@ -214,7 +214,12 @@ package org.apache.flex.binding
             for (var i:int = 0; i < n; i++)
             {
                 var watcher:Object = watchers[i];
-                if (watcher.bindings.indexOf(index) != -1)
+                var isValidWatcher:Boolean = false;
+                if (typeof(watcher.bindings) == "number")
+                    isValidWatcher = (watcher.bindings == index);
+                else
+                    isValidWatcher = (watcher.bindings.indexOf(index) != -1);
+                if (isValidWatcher)
                 {
                     var type:String = watcher.type;
                     switch (type)
@@ -239,7 +244,7 @@ package org.apache.flex.binding
                     }
                     if (watcher.children)
                     {
-                        setupWatchers(gb, index, watcher.children, watcher.watcher);
+                        setupWatchers(gb, index, watcher.children.watchers, watcher.watcher);
                     }
                 }
             }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/e9215c25/frameworks/projects/Binding/asjs/src/org/apache/flex/binding/MXMLBeadViewBaseDataBinding.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Binding/asjs/src/org/apache/flex/binding/MXMLBeadViewBaseDataBinding.as
b/frameworks/projects/Binding/asjs/src/org/apache/flex/binding/MXMLBeadViewBaseDataBinding.as
index 3b6e4f6..5d35cea 100644
--- a/frameworks/projects/Binding/asjs/src/org/apache/flex/binding/MXMLBeadViewBaseDataBinding.as
+++ b/frameworks/projects/Binding/asjs/src/org/apache/flex/binding/MXMLBeadViewBaseDataBinding.as
@@ -213,7 +213,12 @@ package org.apache.flex.binding
             for (var i:int = 0; i < n; i++)
             {
                 var watcher:Object = watchers[i];
-                if (watcher.bindings.indexOf(index) != -1)
+                var isValidWatcher:Boolean = false;
+                if (typeof(watcher.bindings) == "number")
+                    isValidWatcher = (watcher.bindings == index);
+                else
+                    isValidWatcher = (watcher.bindings.indexOf(index) != -1);
+                if (isValidWatcher)
                 {
                     var type:String = watcher.type;
                     switch (type)
@@ -238,7 +243,7 @@ package org.apache.flex.binding
                     }
                     if (watcher.children)
                     {
-                        setupWatchers(gb, index, watcher.children, watcher.watcher);
+                        setupWatchers(gb, index, watcher.children.watchers, watcher.watcher);
                     }
                 }
             }


Mime
View raw message