Hi Piotr,
I'll create a thread to talk about how to do this kind of thing with clear
explanation, so others could suggest how to deal with it. This is not
something related only to Jewel. Any Royale bead that set up a css selector
on the strand will suffer this issue, so I think is important others could
give a hand here.

You can left the change for now, but taking into account that will be
removed in favor of some other generalist solution.

thanks

El sáb., 26 ene. 2019 a las 15:44, Piotr Zarzycki (<
[email protected]>) escribió:

> Ok! Raise an issue if you don't have time to look into that, so we won't
> forget. I can also revert it and will add fix in my own code.
>
> sob., 26 sty 2019 o 15:39 Carlos Rovira <[email protected]>
> napisał(a):
>
> > Hi Piotr,
> >
> > this seems not a proper fix for me. Why Simple*** should be responsible
> of
> > removing selectors of BasicLayout?, and what if instead of the current
> > classes will be others with other selectors?
> >
> > The fix should be something where a bead setup its own selectors when
> added
> > and responsible to remove it when removed or not used.
> >
> > If not the solution is not generalist and we'll end adding many remove
> > lines for all the possible layouts that could be involved, what seems
> very
> > bad solution, don't you think?
> >
> >
> >
> > El sáb., 26 ene. 2019 a las 13:36, <[email protected]> escribió:
> >
> > > This is an automated email from the ASF dual-hosted git repository.
> > >
> > > piotrz 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 17bfa8b  Jewel Group: Fix dynamic adding Horizontal/Vertical
> > > layout
> > > 17bfa8b is described below
> > >
> > > commit 17bfa8b1b98c4c57d2961ee3f183aa1b6d0139ff
> > > Author: Piotr Zarzycki <[email protected]>
> > > AuthorDate: Sat Jan 26 13:35:48 2019 +0100
> > >
> > >     Jewel Group: Fix dynamic adding Horizontal/Vertical layout
> > > ---
> > >  .../royale/jewel/beads/layouts/SimpleHorizontalLayout.as   | 14
> > > ++++++++++++--
> > >  .../royale/jewel/beads/layouts/SimpleVerticalLayout.as     | 14
> > > ++++++++++++--
> > >  2 files changed, 24 insertions(+), 4 deletions(-)
> > >
> > > diff --git
> > >
> >
> a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/SimpleHorizontalLayout.as
> > >
> >
> b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/SimpleHorizontalLayout.as
> > > index 3ec3ce5..b8a7d7f 100644
> > > ---
> > >
> >
> a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/SimpleHorizontalLayout.as
> > > +++
> > >
> >
> b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/SimpleHorizontalLayout.as
> > > @@ -79,11 +79,21 @@ package org.apache.royale.jewel.beads.layouts
> > >                         COMPILE::JS
> > >                         {
> > >                                 if (hostClassList.contains("layout"))
> > > -                                       hostClassList.remove("layout");
> > > +                {
> > > +                    hostClassList.remove("layout");
> > > +                }
> > >                                 hostClassList.add("layout");
> > > +
> > >
>  if(hostClassList.contains("horizontal"))
> > > -
> >  hostClassList.remove("horizontal");
> > > +                {
> > > +                    hostClassList.remove("horizontal");
> > > +                }
> > >                                 hostClassList.add("horizontal");
> > > +
> > > +                if(hostClassList.contains("basic"))
> > > +                {
> > > +                    hostClassList.remove("basic");
> > > +                }
> > >                         }
> > >                 }
> > >
> > > diff --git
> > >
> >
> a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/SimpleVerticalLayout.as
> > >
> >
> b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/SimpleVerticalLayout.as
> > > index 938cc6b..e97db0c 100644
> > > ---
> > >
> >
> a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/SimpleVerticalLayout.as
> > > +++
> > >
> >
> b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/SimpleVerticalLayout.as
> > > @@ -80,11 +80,21 @@ package org.apache.royale.jewel.beads.layouts
> > >                         COMPILE::JS
> > >                         {
> > >                                 if (hostClassList.contains("layout"))
> > > -                                       hostClassList.remove("layout");
> > > +                {
> > > +                    hostClassList.remove("layout");
> > > +                }
> > >                                 hostClassList.add("layout");
> > > +
> > >                                 if(hostClassList.contains("vertical"))
> > > -
>  hostClassList.remove("vertical");
> > > +                {
> > > +                    hostClassList.remove("vertical");
> > > +                }
> > >                                 hostClassList.add("vertical");
> > > +
> > > +                               if(hostClassList.contains("basic"))
> > > +                               {
> > > +                    hostClassList.remove("basic");
> > > +                               }
> > >                         }
> > >                 }
> > >
> > >
> > >
> >
> > --
> > Carlos Rovira
> > http://about.me/carlosrovira
> >
>
>
> --
>
> Piotr Zarzycki
>
> Patreon: *https://www.patreon.com/piotrzarzycki
> <https://www.patreon.com/piotrzarzycki>*
>


-- 
Carlos Rovira
http://about.me/carlosrovira

Reply via email to