flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pio...@apache.org
Subject git commit: [flex-asjs] [refs/heads/develop] - Add "Loading" tab to examples - Make spinner div class element
Date Sun, 18 Dec 2016 09:47:09 GMT
Repository: flex-asjs
Updated Branches:
  refs/heads/develop 85c28f03d -> fe24e3e4c


Add "Loading" tab to examples
- Make spinner div class element


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

Branch: refs/heads/develop
Commit: fe24e3e4ce6ea95a9aa35968dcdfff45219360e3
Parents: 85c28f0
Author: piotrz <piotrz@apache.org>
Authored: Sun Dec 18 10:46:59 2016 +0100
Committer: piotrz <piotrz@apache.org>
Committed: Sun Dec 18 10:46:59 2016 +0100

----------------------------------------------------------------------
 examples/flexjs/MDLExample/src/main/flex/Loading.mxml   |  8 ++++++++
 .../flexjs/MDLExample/src/main/flex/MainNavigation.mxml |  3 +++
 .../src/main/flex/org/apache/flex/mdl/Spinner.as        | 12 +++++++-----
 3 files changed, 18 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fe24e3e4/examples/flexjs/MDLExample/src/main/flex/Loading.mxml
----------------------------------------------------------------------
diff --git a/examples/flexjs/MDLExample/src/main/flex/Loading.mxml b/examples/flexjs/MDLExample/src/main/flex/Loading.mxml
new file mode 100644
index 0000000..7de9cdf
--- /dev/null
+++ b/examples/flexjs/MDLExample/src/main/flex/Loading.mxml
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<!--
+  Created by piotr on 12/18/2016.
+-->
+<mdl:TabBarPanel xmlns:fx="http://ns.adobe.com/mxml/2009"
+                 xmlns:mdl="library://ns.apache.org/flexjs/mdl">
+    <mdl:Spinner isActive="true"/>
+</mdl:TabBarPanel>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fe24e3e4/examples/flexjs/MDLExample/src/main/flex/MainNavigation.mxml
----------------------------------------------------------------------
diff --git a/examples/flexjs/MDLExample/src/main/flex/MainNavigation.mxml b/examples/flexjs/MDLExample/src/main/flex/MainNavigation.mxml
index 39a61a2..ed39a99 100644
--- a/examples/flexjs/MDLExample/src/main/flex/MainNavigation.mxml
+++ b/examples/flexjs/MDLExample/src/main/flex/MainNavigation.mxml
@@ -43,6 +43,7 @@ limitations under the License.
             <mdl:TabBarButton text="TextFields" href="#textfield_panel"/>
             <mdl:TabBarButton text="Toggles" href="#toggles_panel"/>
             <mdl:TabBarButton text="Lists" href="#lists_panel"/>
+            <mdl:TabBarButton text="Loading" href="#loading_panel"/>
             <mdl:TabBarButton text="Other" href="#others_panel"/>
         </mdl:TabBar>
     </mdl:Header>
@@ -79,6 +80,8 @@ limitations under the License.
 
         <local:Lists id="lists_panel"/>
 
+        <local:Loading id="loading_panel"/>
+
         <mdl:TabBarPanel id="others_panel">
             
             <js:Div text="account_box" className="material-icons" style="color: rgba(0,
0, 0, 0.24);">

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fe24e3e4/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Spinner.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Spinner.as
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Spinner.as
index 201966b..496590c 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Spinner.as
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Spinner.as
@@ -59,6 +59,7 @@ package org.apache.flex.mdl
             className = "";
         }
 
+        private var spinner:HTMLDivElement;
         private var _isActive:Boolean;
         private var _singleColor:Boolean;
 
@@ -66,18 +67,19 @@ package org.apache.flex.mdl
         {
             _isActive = value;
 
-            element.classList.toggle("is-active", _isActive);
+            spinner.classList.toggle("is-active", _isActive);
         }
 
         public function set singleColor(value:Boolean):void
         {
             _singleColor = value;
 
-            element.classList.toggle("mdl-spinner--single-color", _singleColor);
+            spinner.classList.toggle("mdl-spinner--single-color", _singleColor);
         }
 
         /**
          * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+         * @flexjsignorecoercion HTMLDivElement
          *
          * @return
          */
@@ -85,14 +87,14 @@ package org.apache.flex.mdl
         {
             typeNames = "mdl-spinner";
 
-            element = document.createElement('div') as WrappedHTMLElement;
-            element.classList.add("mdl-js-spinner");
+            spinner = document.createElement("div") as HTMLDivElement;
+            spinner.classList.add("mdl-js-spinner");
 
+            element = spinner as WrappedHTMLElement;
             positioner = element;
             element.flexjs_wrapper = this;
 
             return element;
         }
-
     }
 }


Mime
View raw message