only add css/js when required
joachim - February 5, 2009 - 09:56
| Project: | Javascript Tools |
| Version: | 5.x-1.2 |
| Component: | Tabs |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Description
The tabs module calls drupal_add_css() and ...js on every single page load.
It would be a lot more efficient to only add the css and js when needed.
I'm not sure where to move the calls to though as I'm not entirely following the flow in the code. tabs_process_tabset()?

#1
Attaching a patch:
- remove call to tabs_load in hook_menu
- make tabs_load a private function rather than a hook
- call it from tabs_process_tabset()