Is there a reason why a drawer should not work?

21 views
Skip to first unread message

Gustavo Gawryszewski

unread,
May 28, 2021, 7:28:13 AM5/28/21
to unp...@googlegroups.com
I mean, is there any constraints that could make the drawer not work and modals and regular targets work.


This doesn't work
<a up-position="right" up-drawer="#body-container" href="//" class="">Academia</a>

This works:
<a up-position="right" up-modal="#body-container" href="/" class="">Academia</a>
<a up-position="right" up-target="#body-container" href="/" class="">Academia</a>

Gustavo Gawryszewski
Mobile: +55 21 99119-2790
Website: http://gawry.com
LinkedIn: http://www.linkedin.com/in/gawry

Henning Koch

unread,
May 28, 2021, 8:05:27 AM5/28/21
to unp...@googlegroups.com
Hi Gustavo,

no such constraints.

If the first [href] is really "//" (double slashes),
that link cannot be followed.

Best regards
Henning


On 28.05.21 13:27, Gustavo Gawryszewski wrote:
> I mean, is there any constraints that could make the drawer not work and
> modals and regular targets work.
>
>
> *This doesn't work*
> <a up-position="right" up-drawer="#body-container" href="//"
> class="">Academia</a>
>
> *This works:*
> <a up-position="right" up-modal="#body-container" href="/"
> class="">Academia</a>
> <a up-position="right" up-target="#body-container" href="/"
> class="">Academia</a>
>
> *Gustavo Gawryszewski*
> Mobile: +55 21 99119-2790
> Website: http://gawry.com <http://gawry.com>
> LinkedIn: http://www.linkedin.com/in/gawry
> <http://www.linkedin.com/in/gawry>
>
> --
> You received this message because you are subscribed to the Google
> Groups "unpoly" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to unpoly+un...@googlegroups.com
> <mailto:unpoly+un...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/unpoly/CAFzj_-PEfhOc48DKRa9X6DnMqO66mC%2B0KpX83WuXejJWYemc0A%40mail.gmail.com
> <https://groups.google.com/d/msgid/unpoly/CAFzj_-PEfhOc48DKRa9X6DnMqO66mC%2B0KpX83WuXejJWYemc0A%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Gustavo Gawryszewski

unread,
May 28, 2021, 8:11:56 AM5/28/21
to unp...@googlegroups.com
No, that's not the real link. The link is the same. I'm just changing the up-{target, modal, drawer} property.  Using the drawer, it looks like it's behaving like a regular link.

Gustavo Gawryszewski

To unsubscribe from this group and stop receiving emails from it, send an email to unpoly+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/unpoly/1629def0-8380-b9af-992a-08231bbd18f2%40gmx.net.

Gustavo Gawryszewski

unread,
May 28, 2021, 8:28:48 AM5/28/21
to unp...@googlegroups.com
The weird thing is that there are no errors. It simply looks like it didn't bind the click to that element and it's only happening within links inside a DataTables table. But for some reason up-modal and up-target works fine.

Gustavo Gawryszewski
Mobile: +55 21 99119-2790
Website: http://gawry.com
LinkedIn: http://www.linkedin.com/in/gawry

adam.me...@gmail.com

unread,
May 28, 2021, 4:46:27 PM5/28/21
to unpoly
Shot in the dark (since you said it's working for other links), but if DataTables is manipulating the DOM, maybe you need to call `up.hello(elementDataTablesInserted)`?

Gustavo Gawryszewski

unread,
May 28, 2021, 5:43:39 PM5/28/21
to unp...@googlegroups.com
That's exactly what happened. But I'm curious to understand why modal and target works and the drawer doesn't

adam.me...@gmail.com

unread,
May 28, 2021, 7:50:14 PM5/28/21
to unpoly
I'm not sure if I'm 100% accurate, but up-drawer is configured with a macro. My guess is that up-modal and up-follow are applied using regular element listeners that are setup on document.


The macro had fired before DataTables modified the DOM.

Henning Koch

unread,
May 29, 2021, 6:12:03 AM5/29/21
to unp...@googlegroups.com
That's exactly the reason.

Best regards
Henning

Am 29.05.2021 um 01:50 schrieb adam.me...@gmail.com:
> I'm not sure if I'm 100% accurate, but up-drawer is configured with a
> macro. My guess is that up-modal and up-follow are applied using regular
> element listeners that are setup on document.
>
> https://github.com/unpoly/unpoly/blob/912b782b60510d4a802dec2e60110f14b6fc98c5/lib/assets/javascripts/unpoly/modal.coffee.erb#L775-L779
>
> The macro had fired before DataTables modified the DOM.
>
> On Friday, May 28, 2021 at 5:43:39 PM UTC-4 gustav...@gmail.com wrote:
>
> That's exactly what happened. But I'm curious to understand why
> modal and target works and the drawer doesn't
>
> Em sex, 28 de mai de 2021 17:46, adam.me...@gmail.com
> <adam.me...@gmail.com> escreveu:
>
> Shot in the dark (since you said it's working for other links),
> but if DataTables is manipulating the DOM, maybe you need to
> call `up.hello(elementDataTablesInserted)`?
>
> On Friday, May 28, 2021 at 8:28:48 AM UTC-4 gustav...@gmail.com
> wrote:
>
> The weird thing is that there are no errors. It simply looks
> like it didn't bind the click to that element and it's only
> happening within links inside a DataTables table. But for
> some reason up-modal and up-target works fine.
>
> *Gustavo Gawryszewski*
> Mobile: +55 21 99119-2790 <tel:+55%2021%2099119-2790>
> On Fri, May 28, 2021 at 9:11 AM Gustavo Gawryszewski
> <gustav...@gmail.com> wrote:
>
> No, that's not the real link. The link is the same. I'm
> just changing the up-{target, modal, drawer} property.
> Using the drawer, it looks like it's behaving like a
> regular link.
>
> *Gustavo Gawryszewski*
> Mobile: +55 21 99119-2790 <tel:+55%2021%2099119-2790>
> > Mobile: +55 21 99119-2790 <tel:+55%2021%2099119-2790>
> > Website: http://gawry.com <http://gawry.com>
> <http://gawry.com <http://gawry.com>>
> > LinkedIn: http://www.linkedin.com/in/gawry
> <http://www.linkedin.com/in/gawry>
> > <http://www.linkedin.com/in/gawry
> <http://www.linkedin.com/in/gawry>>
> >
> > --
> > You received this message because you are
> subscribed to the Google
> > Groups "unpoly" group.
> > To unsubscribe from this group and stop receiving
> emails from it, send
> > an email to unpoly+un...@googlegroups.com
> > <mailto:unpoly+un...@googlegroups.com>.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/unpoly/CAFzj_-PEfhOc48DKRa9X6DnMqO66mC%2B0KpX83WuXejJWYemc0A%40mail.gmail.com
> <https://groups.google.com/d/msgid/unpoly/CAFzj_-PEfhOc48DKRa9X6DnMqO66mC%2B0KpX83WuXejJWYemc0A%40mail.gmail.com>
> >
> <https://groups.google.com/d/msgid/unpoly/CAFzj_-PEfhOc48DKRa9X6DnMqO66mC%2B0KpX83WuXejJWYemc0A%40mail.gmail.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/unpoly/CAFzj_-PEfhOc48DKRa9X6DnMqO66mC%2B0KpX83WuXejJWYemc0A%40mail.gmail.com?utm_medium=email&utm_source=footer>>.
>
> --
> You received this message because you are subscribed
> to the Google Groups "unpoly" group.
> To unsubscribe from this group and stop receiving
> emails from it, send an email to
> unpoly+un...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/unpoly/1629def0-8380-b9af-992a-08231bbd18f2%40gmx.net
> <https://groups.google.com/d/msgid/unpoly/1629def0-8380-b9af-992a-08231bbd18f2%40gmx.net>.
>
> --
> You received this message because you are subscribed to the
> Google Groups "unpoly" group.
> To unsubscribe from this group and stop receiving emails from
> it, send an email to unpoly+un...@googlegroups.com.
>
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/unpoly/dfbb55bd-6d9c-4ea2-84a5-d599a73582fan%40googlegroups.com
> <https://groups.google.com/d/msgid/unpoly/dfbb55bd-6d9c-4ea2-84a5-d599a73582fan%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "unpoly" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to unpoly+un...@googlegroups.com
> <mailto:unpoly+un...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/unpoly/8d3965ef-d315-4aa8-8935-46a305689f54n%40googlegroups.com
> <https://groups.google.com/d/msgid/unpoly/8d3965ef-d315-4aa8-8935-46a305689f54n%40googlegroups.com?utm_medium=email&utm_source=footer>.
Reply all
Reply to author
Forward
0 new messages