flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [20/50] [abbrv] git commit: [flex-asjs] [refs/heads/dual] - replicate e98c41213c1baad005cf157c45ef09e471b2fb02 to Basic
Date Thu, 09 Feb 2017 05:45:12 GMT
replicate e98c41213c1baad005cf157c45ef09e471b2fb02 to Basic


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

Branch: refs/heads/dual
Commit: 79bba0d0ab3c4397f875415ff01ce0042d8a0afe
Parents: 4a04a5d
Author: Alex Harui <aharui@apache.org>
Authored: Mon Feb 6 12:31:37 2017 -0800
Committer: Alex Harui <aharui@apache.org>
Committed: Mon Feb 6 12:31:37 2017 -0800

----------------------------------------------------------------------
 .../org/apache/flex/html/ToggleTextButton.as    | 51 +++++++++++++-------
 .../flex/html/beads/CSSTextToggleButtonView.as  |  4 +-
 2 files changed, 35 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/79bba0d0/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/ToggleTextButton.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/ToggleTextButton.as
b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/ToggleTextButton.as
index 9c4798e..6061898 100644
--- a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/ToggleTextButton.as
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/ToggleTextButton.as
@@ -122,6 +122,7 @@ package org.apache.flex.html
             COMPILE::SWF
             {
                 IToggleButtonModel(model).selected = value;
+                internalSelected()
                 dispatchEvent(new Event("change"));
             }
             COMPILE::JS
@@ -159,30 +160,44 @@ package org.apache.flex.html
             selected = !selected;
         }
 
-        COMPILE::JS
         private function internalSelected():void
         {
-            var isToggleTextButtonSelected:Boolean = element.classList.contains("toggleTextButton_Selected");
-            if (!isToggleTextButtonSelected && _selected == true)
-            {
-                element.classList.add("toggleTextButton_Selected");
-            }
-            else if (isToggleTextButtonSelected && _selected == false)
-            {
-                element.classList.toggle("toggleTextButton_Selected");
-            }
-            
-            var isToggleTextButton:Boolean = element.classList.contains("toggleTextButton");
-            if (!isToggleTextButton && _selected == false)
+            COMPILE::SWF
             {
-                element.classList.add("toggleTextButton");
+                var name:String = super.className;
+                if (selected)
+                {
+                    className = "toggleTextButton_Selected" + (name ? " " + name : "");
+                }
+                else
+                {
+                    className = "toggleTextButton" + (name ? " " + name : "");
+                }
             }
-            else if (isToggleTextButton && _selected == true)
+            COMPILE::JS
             {
-                element.classList.toggle("toggleTextButton");
+                var isToggleTextButtonSelected:Boolean = element.classList.contains("toggleTextButton_Selected");
+                if (!isToggleTextButtonSelected && _selected == true)
+                {
+                    element.classList.add("toggleTextButton_Selected");
+                }
+                else if (isToggleTextButtonSelected && _selected == false)
+                {
+                    element.classList.toggle("toggleTextButton_Selected");
+                }
+                
+                var isToggleTextButton:Boolean = element.classList.contains("toggleTextButton");
+                if (!isToggleTextButton && _selected == false)
+                {
+                    element.classList.add("toggleTextButton");
+                }
+                else if (isToggleTextButton && _selected == true)
+                {
+                    element.classList.toggle("toggleTextButton");
+                }
+                
+                typeNames = element.className;
             }
-            
-            typeNames = element.className;
         }
 
 	}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/79bba0d0/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/CSSTextToggleButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/CSSTextToggleButtonView.as
b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/CSSTextToggleButtonView.as
index 7de01ef..0be56d9 100644
--- a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/CSSTextToggleButtonView.as
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/CSSTextToggleButtonView.as
@@ -89,13 +89,13 @@ package org.apache.flex.html.beads
             var className:String = IStyleableObject(_strand).className;
             if (toggleButtonModel.selected)
             {
-                if (className.indexOf(SELECTED) == className.length - SELECTED.length)
+                if (className && className.indexOf(SELECTED) == className.length
- SELECTED.length)
                     IStyleableObject(_strand).className = className.substring(0, className.length
- SELECTED.length);
                 setupSkins();
             }
             else
             {
-                if (className.indexOf(SELECTED) == -1)
+                if (className && className.indexOf(SELECTED) == -1)
                     IStyleableObject(_strand).className += SELECTED;
                 setupSkins();                
             }


Mime
View raw message