flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [11/50] git commit: [flex-asjs] [refs/heads/tlf] - switch to using addRule so styles set up properly for JS
Date Tue, 30 May 2017 19:47:46 GMT
switch to using addRule so styles set up properly for JS


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

Branch: refs/heads/tlf
Commit: 1ee9866b578146c8576cc23a30816bc1c0e86e1d
Parents: 7b26ee3
Author: Alex Harui <aharui@apache.org>
Authored: Tue May 23 22:37:07 2017 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Tue May 23 22:37:13 2017 -0700

----------------------------------------------------------------------
 .../src/main/flex/DataBindingExample.as         | 52 +++++++++++++-------
 1 file changed, 33 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1ee9866b/examples/flexjs/DataBindingExample_as/src/main/flex/DataBindingExample.as
----------------------------------------------------------------------
diff --git a/examples/flexjs/DataBindingExample_as/src/main/flex/DataBindingExample.as b/examples/flexjs/DataBindingExample_as/src/main/flex/DataBindingExample.as
index 848b0ab..225271b 100644
--- a/examples/flexjs/DataBindingExample_as/src/main/flex/DataBindingExample.as
+++ b/examples/flexjs/DataBindingExample_as/src/main/flex/DataBindingExample.as
@@ -104,40 +104,44 @@ public class DataBindingExample extends Application
     private function setupStyles(vi:SimpleCSSValuesImpl):void
     {
         var viv:Object = vi.values = {};
-        viv["global"] =
+        vi.addRule("global",
         {
             fontFamily: "Arial",
             fontSize: 12
-        };
+        });
 
-        var o:Object;
-
-        o = viv[makeDefinitionName("org.apache.flex.html::Container")] =
+		var s:String = makeDefinitionName("org.apache.flex.html::Container");
+        vi.addRule(s,
         {
 
             iBeadView: ContainerView,
     		iBeadLayout: BasicLayout
-        };
+        });
 
+	   var o:Object;
        COMPILE::SWF {
+		    o = vi.values[s];
         	o.iContentView = ContainerContentArea;
          	o.iViewport = Viewport;
          	o.iViewportModel = ViewportModel;
          };
 
-        o = viv[makeDefinitionName("org.apache.flex.core::View")] =
+        s = makeDefinitionName("org.apache.flex.core::View");
+		vi.addRule(s,
         {
 
             iBeadView: GroupView,
     		iBeadLayout: BasicLayout
-        };
+        });
 
         COMPILE::SWF {
+		    o = vi.values[s];
             o.iBackgroundBead = SolidBackgroundBead;
             o.iBorderBead = SingleLineBorderBead;
         }
 
-        viv[makeDefinitionName("org.apache.flex.html::List")] =
+        s = makeDefinitionName("org.apache.flex.html::List");
+		vi.addRule(s,
         {
             iBeadModel: ArraySelectionModel,
             iBeadView:  ListView,
@@ -149,31 +153,41 @@ public class DataBindingExample extends Application
 			iViewportModel: ViewportModel,
             iItemRendererClassFactory: ItemRendererClassFactory,
             iItemRenderer: StringItemRenderer
-        };
+        });
 
-        o = viv[makeDefinitionName("org.apache.flex.html::Button")] =
+        s = makeDefinitionName("org.apache.flex.html::Button");
+		vi.addRule(s,
         {
             backgroundColor: 0xd8d8d8,
-            border: [1, "solid", 0x000000],
+			borderWidth: 1,
+			borderStyle: "solid",
+			borderColor: 0x000000,
             padding: 4
-        };
+        });
         COMPILE::SWF {
+		    o = vi.values[s];
             o.iBeadView = CSSButtonView;
         }
 
-        viv[makeDefinitionName("org.apache.flex.html::Button:hover")] =
+        s = makeDefinitionName("org.apache.flex.html::Button:hover");
+		vi.addRule(s,
         {
             backgroundColor: 0x9fa0a1,
-            border: [1, "solid", 0x000000],
+			borderWidth: 1,
+			borderStyle: "solid",
+			borderColor: 0x000000,
             padding: 4
-        };
+        });
 
-        viv[makeDefinitionName("org.apache.flex.html::Button:active")] =
+        s = makeDefinitionName("org.apache.flex.html::Button:active");
+		vi.addRule(s,
         {
             backgroundColor: 0x929496,
-            border: [1, "solid", 0x000000],
+			borderWidth: 1,
+			borderStyle: "solid",
+			borderColor: 0x000000,
             padding: 4
-        };
+        });
 
         COMPILE::SWF {
             viv["org.apache.flex.html::CheckBox"] =


Mime
View raw message