flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [1/5] git commit: [flex-asjs] [refs/heads/core_js_to_as] - attempt to fold JS into PlatformWiper
Date Wed, 11 Nov 2015 05:35:29 GMT
Repository: flex-asjs
Updated Branches:
  refs/heads/core_js_to_as 6bfbe8272 -> 18f159c14


attempt to fold JS into PlatformWiper


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

Branch: refs/heads/core_js_to_as
Commit: 9c93c53628a53518a35569d1b6b999d50aa52d47
Parents: 6bfbe82
Author: Alex Harui <aharui@apache.org>
Authored: Tue Nov 10 20:55:00 2015 -0800
Committer: Alex Harui <aharui@apache.org>
Committed: Tue Nov 10 20:55:00 2015 -0800

----------------------------------------------------------------------
 .../org/apache/flex/effects/PlatformWiper.as    | 50 +++++++++++++++++---
 1 file changed, 44 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9c93c536/frameworks/projects/Effects/as/src/org/apache/flex/effects/PlatformWiper.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Effects/as/src/org/apache/flex/effects/PlatformWiper.as b/frameworks/projects/Effects/as/src/org/apache/flex/effects/PlatformWiper.as
index f9d2486..2ffe9d9 100644
--- a/frameworks/projects/Effects/as/src/org/apache/flex/effects/PlatformWiper.as
+++ b/frameworks/projects/Effects/as/src/org/apache/flex/effects/PlatformWiper.as
@@ -20,8 +20,15 @@
 package org.apache.flex.effects
 {
 
-import flash.display.DisplayObject;
-import flash.geom.Rectangle;
+COMPILE::AS3
+{
+    import flash.display.DisplayObject;
+    import flash.geom.Rectangle;            
+}
+COMPILE::JS
+{
+    import org.apache.flex.geom.Rectangle;
+}
 
 import org.apache.flex.core.IDocument;
 import org.apache.flex.core.IUIBase;
@@ -69,6 +76,12 @@ public class PlatformWiper
 	private var _target:IUIBase;
       
     /**
+     *  @private
+     *  The old overflow value.
+     */
+    private var _overflow:String;
+    
+    /**
      *  The object that will be clipped.
      *
      *  @langversion 3.0
@@ -78,9 +91,26 @@ public class PlatformWiper
      */
     public function set target(value:IUIBase):void
     {
-        if (value == null)
-            DisplayObject(_target).scrollRect = null;
-        _target = value;
+        COMPILE::AS3
+        {
+            if (value == null)
+                DisplayObject(_target).scrollRect = null;
+            _target = value;                
+        }
+        COMPILE::JS
+        {
+            if (value == null) 
+            {
+                if (_overflow == null)
+                    delete _target.positioner.style.overflow;
+                else
+                    _target.positioner.style.overflow = _overflow;
+            }
+            _target = target;
+            if (value != null) {
+                _overflow = _target.positioner.style.overflow;
+            }
+        }
     }
     
     /**
@@ -93,7 +123,15 @@ public class PlatformWiper
      */
     public function set visibleRect(value:Rectangle):void
     {
-        DisplayObject(_target).scrollRect = value;
+        COMPILE::AS3
+        {
+            DisplayObject(_target).scrollRect = value;                
+        }
+        COMPILE::JS
+        {
+            _target.positioner.style.height = value.height.toString() + 'px';
+            _target.positioner.style.overflow = 'hidden';
+        }
     }
 }
 


Mime
View raw message