juvia icon indicating copy to clipboard operation
juvia copied to clipboard

Fire javascript event when comments have loaded

Open JangoSteve opened this issue 12 years ago • 1 comments

I wanted to make sure you thought this was a good idea before adding it myself.

I have certain code I'd like to run after the comments content has loaded. For example, I need to add a special styling class to the form submit button so that it'll get styled according to the btn class from twitter bootstrap. I currently accomplished this by adding this to the bottom of the juvia javascript:

s.onload = s.onreadystatechange = function(){
  $(options.container).find('input[type="submit"]').addClass('btn btn-success');
};

However, it'd be a lot cleaner if maybe juvia fired a juvia:loaded event or something like that on the juvia container that could be easily handled.

JangoSteve avatar Feb 05 '13 02:02 JangoSteve

Yes I think that's a good idea. Go ahead.

FooBarWidget avatar Feb 05 '13 09:02 FooBarWidget