Adam Garbinski
Posts: 0
Joined: Sat Sep 28, 2013 5:33 pm

Even more developer-friendly event handling JS and CSS

Hello Appery and anybody concerned,
My idea is to improve a bit custom Javascript and CSS handling. When you select RUN JAVASCRIPT event you can only put your custom JS code in here which is fine and I would leave it that way. However it would be nice to have an extra option to pick the Javascript asset you have already created in your project (from the dropdown for example), so it would get attached to that event. Now I just type manually the name of the function to invoke this JS asset but this solution seems more elegent and useful to me. Of course the exact behaviour is yet to be determined (renaming or deleting JS asset for example) but I am sure there is a good option to solve this.
I would recommend the same approach in case of attaching CSS assets to components.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Even more developer-friendly event handling JS and CSS

You would select a function that's available in a custom JavaScript file you created?

Adam Garbinski
Posts: 0
Joined: Sat Sep 28, 2013 5:33 pm

Even more developer-friendly event handling JS and CSS

Yes Max. Maybe this is wrong practice but I tend to move more complex to custom JS instead of writing it directly under events. So it would help in it.
Perhaps you could then even think of editing such JS asset directly from component ? (accesisng and editing JS asset would be possible from two different places, like current JS asset tree and component event).

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Even more developer-friendly event handling JS and CSS

It is in fact a good practice, to place large code sections in a separate JavaScript file and the invoke it from an action. In general, Run JavaScript is good for "small" JavaScript logic.

Adam Garbinski
Posts: 0
Joined: Sat Sep 28, 2013 5:33 pm

Even more developer-friendly event handling JS and CSS

Well, thanks for clearing that up Max.
Cheers,
Adam

Return to “Issues”