Add possibility to define default options (only attach_jquery_bettertabs_inline for now) in an initializer #6

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@manuelmeurer
Contributor

I didn't want to render the JS code to activate the tabs directly after rendering them (it requires jQuery to be available at that point, which I include at the bottom of the page), so I used the attach_jquery_bettertabs_inline option but including it with every call to the helper got old very quick, so I added a simple Configuration class to be able to set attach_jquery_bettertabs_inline in an initializer.

The Configuration class could be used to store many more options (like render_only_active_content, class, id, etc.).

@marioizquierdo
Owner

Actually, now I'm thinking more about this.. and it looks to me that the default should be not to include the jquery call inline.
True is that it makes more easy to set up, but it is encouraging a bad practice of having the jquery script loaded before the DOM is loaded.

I'm adding this pull request to the version 1.4, but also setting the default value to false and updating the README file.
Thanks

@marioizquierdo marioizquierdo referenced this pull request Jun 17, 2012
Merged

Version 1 4 #12

@manuelmeurer
Contributor

Yes, I agree. I just left the default at true because it was true before.

@marioizquierdo
Owner

@manuelmeurer if you update to the v1.4 now you should be able to remove the initializer and things should "just work", because the default value is adapted to your case, that is a "good practice"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment