flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yishay Weiss <yishayj...@hotmail.com>
Subject RE: git commit: [flex-asjs] [refs/heads/develop] - Don't let order of bead addition confuse collapse bead.
Date Mon, 28 Nov 2016 10:57:25 GMT
This is a form of lazy loading. We’re not baking in any new dependencies that weren’t there
before. If you look in ContainerView.performLayout(), for example, you’ll see it’s doing
the same thing.



Some beads rely on other beads to already be loaded, this code essentially makes sure that
the dependencies are loaded.



From: Piotr Zarzycki<mailto:piotrzarzycki21@gmail.com>
Sent: Monday, November 28, 2016 11:19 AM
To: dev@flex.apache.org<mailto:dev@flex.apache.org>
Cc: commits@flex.apache.org<mailto:commits@flex.apache.org>
Subject: Re: git commit: [flex-asjs] [refs/heads/develop] - Don't let order of bead addition
confuse collapse bead.



Hi Yishay,

This layout property is not only returning something but also adding - It
doesn't look good. Is there any other option ?

2016-11-28 9:58 GMT+01:00 <yishayw@apache.org>:

> Repository: flex-asjs
> Updated Branches:
>   refs/heads/develop ce807561d -> 1ae995db3
>
>
> Don't let order of bead addition confuse collapse bead.
>
>
> Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
> Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/1ae995db
> Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/1ae995db
> Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/1ae995db
>
> Branch: refs/heads/develop
> Commit: 1ae995db37ec4c8dbab763b4865a25cf2436e32a
> Parents: ce80756
> Author: yishayw <yishayjobs@hotmail.com>
> Authored: Mon Nov 28 10:58:49 2016 +0200
> Committer: yishayw <yishayjobs@hotmail.com>
> Committed: Mon Nov 28 10:58:49 2016 +0200
>
> ----------------------------------------------------------------------
>  .../flex/html/beads/AccordionCollapseBead.as    | 23 +++++++++++++++++++-
>  1 file changed, 22 insertions(+), 1 deletion(-)
> ----------------------------------------------------------------------
>
>
> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/
> 1ae995db/frameworks/projects/HTML/src/main/flex/org/apache/
> flex/html/beads/AccordionCollapseBead.as
> ----------------------------------------------------------------------
> diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/
> html/beads/AccordionCollapseBead.as b/frameworks/projects/HTML/
> src/main/flex/org/apache/flex/html/beads/AccordionCollapseBead.as
> index d666fc1..f0e9081 100644
> --- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/
> AccordionCollapseBead.as
> +++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/
> AccordionCollapseBead.as
> @@ -20,6 +20,7 @@ package org.apache.flex.html.beads
>  {
>         import org.apache.flex.core.IStrand;
>         import org.apache.flex.core.UIBase;
> +       import org.apache.flex.core.ValuesManager;
>         import org.apache.flex.events.Event;
>         import org.apache.flex.html.Accordion;
>         import org.apache.flex.html.beads.layouts.IOneFlexibleChildLayout;
> @@ -29,6 +30,7 @@ package org.apache.flex.html.beads
>         {
>                 private var _strand:IStrand;
>                 private var lastSelectedIndex:int = -1;
> +               private var _layout:IOneFlexibleChildLayout;
>                 public function AccordionCollapseBead()
>                 {
>                 }
> @@ -52,7 +54,6 @@ package org.apache.flex.html.beads
>                         {
>                                 return;
>                         }
> -                       var layout:IOneFlexibleChildLayout =
> host.getBeadByType(IOneFlexibleChildLayout) as IOneFlexibleChildLayout;
>                         if (lastSelectedIndex > -1)
>                         {
>                                 var lastElement:ICollapsible =
> view.dataGroup.getItemRendererForIndex(lastSelectedIndex) as ICollapsible;
> @@ -62,5 +63,25 @@ package org.apache.flex.html.beads
>                         layout.flexibleChild = newChild.id;
>                         layout.layout();
>                 }
> +
> +               private function get layout():IOneFlexibleChildLayout
> +               {
> +                       if (!_layout)
> +                       {
> +                               _layout = _strand.getBeadByType(IOneFlexibleChildLayout)
> as IOneFlexibleChildLayout;
> +                               if (!_layout) {
> +                                       var c:Class =
> ValuesManager.valuesImpl.getValue(host, "iBeadLayout");
> +                                       if (c) {
> +                                               _layout = new c() as
> IOneFlexibleChildLayout;
> +                                       }
> +                               }
> +                               if (_layout)
> +                               {
> +                                       _strand.addBead(_layout);
> +                               }
> +                       }
> +                       return _layout;
> +               }
> +
>         }
>  }
> \ No newline at end of file
>
>


--

Greetings
Piotr Zarzycki

Flex/AIR/.NET Developer

mobile: +48 880 859 557
e-mail: piotrzarzycki21@gmail.com
skype: zarzycki10

LinkedIn: http://www.linkedin.com/piotrzarzycki
<https://pl.linkedin.com/in/piotr-zarzycki-92a53552>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message