You are here

function collapse_text_init in Collapse Text 5

Implementation of hook_init().

Due to caching issues, `collapse.js` is not properly added to a page when the cached version is used. This adds `collapse.js` to every page. This is not really the right way to solve the problem, but I don't know that Drupal provides us with the ability to attach CSS files to input filter caches.

Per #256354 and #231529. Thanks rolf, sza, jippie1948, Justyn

File

./collapse_text.module, line 124
collapse_text is an input filter that allows text to be collapsible

Code

function collapse_text_init() {

  // Per #349257 and private message from SyndicatePlus
  // some kind of caching issue?
  if (function_exists('drupal_add_js')) {
    drupal_add_js('misc/collapse.js', 'core');
  }
}