There is nothing in AS preventing to use other js files. Maybe issue is 
elements you want to link are loaded by AJAX, so when document ready is run 
there are not present yet, is it possible?

You could try to use on to attach listener to document and delegate to links:

$(document).on('click', 'a[data-background-color]', (e) ->
  e.preventDefault()
  ...
);

El sábado, 19 de marzo de 2016 9:59:28 (CET) loveand light escribió:
> I should rephrase this... does AS have any problem using other js files
> that have been included at load time? I am doing something pretty simple
> but can't get it to activate...below is the simple test that I am compiling
> at runtime but it would work inside a AS frame.
> 
> 
> # Place all the behaviors and hooks related to the matching controller here.
> # All this logic will automatically be available in application.js. # You
> can use CoffeeScript in this file: http://coffeescript.org/
> paintIt = (element, backgroundColor, textColor) ->
>   element.style.backgroundColor = backgroundColor
>   if textColor?
>     element.style.color = textColor
> 
> $ ->
>   $("a[data-background-color]").click (e) ->
>     e.preventDefault()
>     console.log 'mark'
>     alert 'test'
>     backgroundColor = $(this).data("background-color")
>     textColor = $(this).data("text-color")
>     paintIt(this, backgroundColor, textColor)
> 
> On Saturday, March 19, 2016 at 11:03:45 AM UTC-4, loveand light wrote:
> > Curious,
> > 
> > Does ActiveScaffold play nice with CoffeeScript? I am having trouble
> > loading in anything coffeescript once an active scaffold page is embeded.
> > Has anyone else experienced this problem?
> > 
> > Thanks.


-- 
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails Gem" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/activescaffold.
For more options, visit https://groups.google.com/d/optout.

Reply via email to