This is an automated email from the ASF dual-hosted git repository.
carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
The following commit(s) were added to refs/heads/develop by this push:
new 0866cb0 jewel: how to make a Navigator item disabled
0866cb0 is described below
commit 0866cb040b674dc1a793f8a3e95d38b7883f7ba0
Author: Carlos Rovira <[email protected]>
AuthorDate: Sun Dec 6 20:54:01 2020 +0100
jewel: how to make a Navigator item disabled
---
.../src/main/royale/itemRenderers/NavigationIconLinkItemRenderer.mxml | 3 ++-
.../jewel/TourDeJewel/src/main/royale/models/MainNavigationModel.as | 2 +-
examples/jewel/TourDeJewel/src/main/royale/vos/NavigationLinkVO.as | 4 +++-
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git
a/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/NavigationIconLinkItemRenderer.mxml
b/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/NavigationIconLinkItemRenderer.mxml
index 86c92f0..e77f204 100644
---
a/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/NavigationIconLinkItemRenderer.mxml
+++
b/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/NavigationIconLinkItemRenderer.mxml
@@ -22,7 +22,7 @@ limitations under the License.
xmlns:js="library://ns.apache.org/royale/basic"
xmlns:html="library://ns.apache.org/royale/html"
xmlns="http://www.w3.org/1999/xhtml"
- height="48">
+ height="48" style="{navlink.disabled ? 'color: #dedede' : '' }">
<fx:Script>
<![CDATA[
@@ -39,6 +39,7 @@ limitations under the License.
<j:beads>
<js:ItemRendererDataBinding />
<j:HorizontalLayout gap="8" itemsVerticalAlign="itemsCenter"/>
+ <j:Disabled disabled="{navlink.disabled}"/>
</j:beads>
<js:MaterialIcon text="{navlink.icon}" visible="{navlink.icon != null}"/>
diff --git
a/examples/jewel/TourDeJewel/src/main/royale/models/MainNavigationModel.as
b/examples/jewel/TourDeJewel/src/main/royale/models/MainNavigationModel.as
index 6b3af86..58fee31 100644
--- a/examples/jewel/TourDeJewel/src/main/royale/models/MainNavigationModel.as
+++ b/examples/jewel/TourDeJewel/src/main/royale/models/MainNavigationModel.as
@@ -53,7 +53,7 @@ package models
{
return _controlsDrawerNavigation;
}
-
+ // Note: for disable a node add a "true" as a final param on the
obejct you want. This is "false" by default
private var _containerDrawerNavigation:ArrayList = new ArrayList([
new NavigationLinkVO("Card", "card_panel",
MaterialIconType.WEB_ASSET),
new NavigationLinkVO("Layouts", "layouts_panel",
MaterialIconType.VIEW_QUILT),
diff --git a/examples/jewel/TourDeJewel/src/main/royale/vos/NavigationLinkVO.as
b/examples/jewel/TourDeJewel/src/main/royale/vos/NavigationLinkVO.as
index 5d74999..e0dc38f 100644
--- a/examples/jewel/TourDeJewel/src/main/royale/vos/NavigationLinkVO.as
+++ b/examples/jewel/TourDeJewel/src/main/royale/vos/NavigationLinkVO.as
@@ -26,17 +26,19 @@ package vos
public var label:String;
public var hash:String;
public var icon:String;
+ public var disabled:Boolean;
//for collapsible example
public var subMenu:IArrayList;
public var open:Boolean;
public var selectedChild:NavigationLinkVO;
- public function NavigationLinkVO(label:String, hash:String,
icon:String = null)
+ public function NavigationLinkVO(label:String, hash:String,
icon:String = null, disabled:Boolean = false)
{
this.label = label;
this.hash = hash;
this.icon = icon;
+ this.disabled = disabled;
}
}
}