These are chat archives for ractivejs/ractive

18th
Oct 2018
Chris Reeves
@evs-chris
Oct 18 2018 01:51
I may be missing the intent, but you just need to move the click listener up since you're proxing it from the outer component
Cerem Cem ASLAN
@ceremcem
Oct 18 2018 07:28
Intention: I want to "click" a button (any button) programmatically. Here is a more clear example: Playground
Martin Kolárik
@MartinKolarik
Oct 18 2018 08:55

the only trick I know is using regex. but regex is "write once and forget about reading it ever" IMHO

IMHO after a bit of practice, regexes are very easy to read :grinning:

Cerem Cem ASLAN
@ceremcem
Oct 18 2018 11:38
@MartinKolarik it's only you and Neo.
Arnaud Dagnelies
@dagnelies
Oct 18 2018 16:59
I agree, it's just a question of practice ;)
Chris Reeves
@evs-chris
Oct 18 2018 18:20
@ceremcem I think there may be a bug here, because on-click=foo doesn't fire but on-click="@.fire('foo')" does
it looks like you swapped the yield for a plain partial too, which is why the handler moved here
Cerem Cem ASLAN
@ceremcem
Oct 18 2018 18:28
interesting. do you want me to file an issue for that?
and yes, I changed {{>content}} to {{yield}} because it seemed like it would work that way. Now, if I replace that {{yield}} with {{>content}} it stops working even though on-click="@.fire..." is used: Playground
Chris Reeves
@evs-chris
Oct 18 2018 18:45
yes, please file an issue so I don't forget to look into it
changing out the yield requires some rearrangement
you either have to manually proxy the clicks around the partial
Chris Reeves
@evs-chris
Oct 18 2018 18:50
or use a scoped listener
Cerem Cem ASLAN
@ceremcem
Oct 18 2018 19:27
my original use case is a little bit more complex than that and I currently use a workaround by observing variables
by the way, regarding to our previous discussion about using Ractive as a SVG generation template, here is the current situation: This task is more complex than it seems and I think there is a suitable library for this job: Paper.js
Cerem Cem ASLAN
@ceremcem
Oct 18 2018 19:33
As @fskreuz suggests using canvas, it might fit better in the case as it uses canvas for displaying graphics
Cerem Cem ASLAN
@ceremcem
Oct 18 2018 19:38
current status here: https://aktos.io/aecad/#/sketcher