flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ha...@apache.org
Subject git commit: [flex-asjs] [refs/heads/feature/flexjs_wrapper] - Removed setting flexjs_wrapper from Flat
Date Tue, 26 Sep 2017 18:40:00 GMT
Repository: flex-asjs
Updated Branches:
  refs/heads/feature/flexjs_wrapper 386dc04dd -> ce4469e73


Removed setting flexjs_wrapper from Flat


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

Branch: refs/heads/feature/flexjs_wrapper
Commit: ce4469e7393550511b8500fbad97302f89aeee8f
Parents: 386dc04
Author: Harbs <harbs@in-tools.com>
Authored: Tue Sep 26 21:39:56 2017 +0300
Committer: Harbs <harbs@in-tools.com>
Committed: Tue Sep 26 21:39:56 2017 +0300

----------------------------------------------------------------------
 .../main/flex/org/apache/flex/flat/CheckBox.as  |  7 +---
 .../flex/org/apache/flex/flat/DropDownList.as   | 39 ++++++++------------
 .../flex/org/apache/flex/flat/RadioButton.as    |  8 ++--
 3 files changed, 21 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ce4469e7/frameworks/projects/Flat/src/main/flex/org/apache/flex/flat/CheckBox.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Flat/src/main/flex/org/apache/flex/flat/CheckBox.as b/frameworks/projects/Flat/src/main/flex/org/apache/flex/flat/CheckBox.as
index 497ea48..1c4a947 100644
--- a/frameworks/projects/Flat/src/main/flex/org/apache/flex/flat/CheckBox.as
+++ b/frameworks/projects/Flat/src/main/flex/org/apache/flex/flat/CheckBox.as
@@ -27,6 +27,7 @@ package org.apache.flex.flat
         import org.apache.flex.core.UIBase;
         import org.apache.flex.core.WrappedHTMLElement;
         import org.apache.flex.events.Event;
+        import org.apache.flex.html.addElementToWrapper;
     }
 
     /**
@@ -87,8 +88,7 @@ package org.apache.flex.flat
          */
         override protected function createElement():WrappedHTMLElement
         {
-                label = document.createElement('label') as HTMLLabelElement;
-                element = label as WrappedHTMLElement;
+                label = addElementToWrapper(this,'label') as HTMLLabelElement;
                 
                 input = document.createElement('input') as HTMLInputElement;
                 input.type = 'checkbox';
@@ -107,12 +107,9 @@ package org.apache.flex.flat
                 label.className = 'CheckBox';
                 typeNames = 'CheckBox';
                 
-                positioner = element;
                 positioner.style.position = 'relative';
                 (input as WrappedHTMLElement).flexjs_wrapper = this;
                 (checkbox as WrappedHTMLElement).flexjs_wrapper = this;
-                element.flexjs_wrapper = this;
-                
                 return element;
             };
         

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ce4469e7/frameworks/projects/Flat/src/main/flex/org/apache/flex/flat/DropDownList.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Flat/src/main/flex/org/apache/flex/flat/DropDownList.as b/frameworks/projects/Flat/src/main/flex/org/apache/flex/flat/DropDownList.as
index 4e876e2..c80d6e6 100644
--- a/frameworks/projects/Flat/src/main/flex/org/apache/flex/flat/DropDownList.as
+++ b/frameworks/projects/Flat/src/main/flex/org/apache/flex/flat/DropDownList.as
@@ -27,6 +27,7 @@ package org.apache.flex.flat
     COMPILE::JS
     {
         import goog.events;
+        import org.apache.flex.html.addElementToWrapper;
         import org.apache.flex.html.List;
         import org.apache.flex.core.WrappedHTMLElement;
         import org.apache.flex.core.ISelectionModel;
@@ -105,40 +106,32 @@ package org.apache.flex.flat
          */
         override protected function createElement():WrappedHTMLElement
         {
-            var button:HTMLButtonElement;
-            var outer:HTMLDivElement;
-            var caret:HTMLSpanElement;
-            
-            this.element = document.createElement('div') as WrappedHTMLElement;
-            outer = this.element as HTMLDivElement;
+            addElementToWrapper(this,'div');
             
-            this.button = button = document.createElement('button') as HTMLButtonElement;
+            button = document.createElement('button') as HTMLButtonElement;
             button.className = 'dropdown-toggle-open-btn';
             if (this.className)
                 button.className += ' ' + this.className;
             goog.events.listen(button, 'click', buttonClicked);
-            outer.appendChild(button);
+            element.appendChild(button);
             
-            this.label = document.createElement('span') as HTMLSpanElement;
-            this.label.className = 'dropdown-label';
+            label = document.createElement('span') as HTMLSpanElement;
+            label.className = 'dropdown-label';
             button.appendChild(this.label);
-            this.caret = caret = document.createElement('span') as HTMLSpanElement;
+            caret = document.createElement('span') as HTMLSpanElement;
             button.appendChild(caret);
             caret.className = 'dropdown-caret';
             
-            this.positioner = this.element;
-            this.positioner.style.position = 'relative';
+            positioner.style.position = 'relative';
             
             // add a click handler so that a click outside of the combo box can
             // dismiss the pop-up should it be visible.
             goog.events.listen(document, 'click', dismissPopup);
             
             (button as WrappedHTMLElement).flexjs_wrapper = this;
-            this.element.flexjs_wrapper = this;
-            (this.label as WrappedHTMLElement).flexjs_wrapper = this;
+            (label as WrappedHTMLElement).flexjs_wrapper = this;
             (caret as WrappedHTMLElement).flexjs_wrapper = this;
-            
-            return this.element;
+            return element;
         }
         
         
@@ -231,7 +224,7 @@ package org.apache.flex.flat
                 else
                     ir.innerHTML = dp[i];
                 ir.id = i.toString();
-                if (i == this.selectedIndex)
+                if (i == selectedIndex)
                     ir.className = 'dropdown-menu-item-renderer-selected';
                 else
                     ir.className = 'dropdown-menu-item-renderer';
@@ -239,7 +232,7 @@ package org.apache.flex.flat
                 select.appendChild(opt);
             }
             
-            this.element.appendChild(select);
+            element.appendChild(select);
         };
         
         
@@ -258,15 +251,15 @@ package org.apache.flex.flat
             var bl:Number = CSSUtils.toNumber(s);
             s = cv.borderRightWidth;
             var br:Number = CSSUtils.toNumber(s);
-            var caretWidth:Number = this.caret.offsetWidth;
+            var caretWidth:Number = caret.offsetWidth;
             // 10 seems to factor spacing between span and extra FF padding?
             var fluff:Number = pl + pr + bl + br + caretWidth + 1 + 10;
-            var labelWidth:Number = this.width - fluff;
+            var labelWidth:Number = width - fluff;
             var strWidth:String = labelWidth.toString();
             strWidth += 'px';
-            this.label.style.width = strWidth;
+            label.style.width = strWidth;
 			
-			this.positioner.style.overflow = 'visible';
+			positioner.style.overflow = 'visible';
         }       
         
         override public function set className(value:String):void

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ce4469e7/frameworks/projects/Flat/src/main/flex/org/apache/flex/flat/RadioButton.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Flat/src/main/flex/org/apache/flex/flat/RadioButton.as b/frameworks/projects/Flat/src/main/flex/org/apache/flex/flat/RadioButton.as
index e4bb322..bac3dc4 100644
--- a/frameworks/projects/Flat/src/main/flex/org/apache/flex/flat/RadioButton.as
+++ b/frameworks/projects/Flat/src/main/flex/org/apache/flex/flat/RadioButton.as
@@ -26,6 +26,7 @@ package org.apache.flex.flat
     {
         import org.apache.flex.core.UIBase;
         import org.apache.flex.core.WrappedHTMLElement;
+        import org.apache.flex.html.addElementToWrapper;
     }
     
     /**
@@ -103,23 +104,20 @@ package org.apache.flex.flat
             
             textNode = document.createTextNode('radio button') as Text;
             
-            labelFor = document.createElement('label') as HTMLLabelElement;
+            //element
+            labelFor = addElementToWrapper(this,'label') as HTMLLabelElement;
             labelFor.appendChild(input);
             labelFor.appendChild(radio);
             labelFor.appendChild(textNode);
             labelFor.style.position = 'relative';
             
-            element = labelFor as WrappedHTMLElement;
             element.className = 'RadioButton';
             typeNames = 'RadioButton';
             
-            positioner = element;
             positioner.style.position = 'relative';
             (input as WrappedHTMLElement).flexjs_wrapper = this;
             (radio as WrappedHTMLElement).flexjs_wrapper = this;
-            element.flexjs_wrapper = this;
             (textNode as WrappedHTMLElement).flexjs_wrapper = this;
-            
             return element;
         }
         


Mime
View raw message