diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-07-10 05:45:56 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-07-10 05:45:56 +0000 |
commit | ffc8cab84b79857e46849ed80a6de89a03defc68 (patch) | |
tree | 5eab30ddd31add1fb7ee0b49dc08da797244c603 /includes | |
parent | 976336e2f874192a7a5c720e9f93b61b6a05cf3b (diff) | |
download | brdo-ffc8cab84b79857e46849ed80a6de89a03defc68.tar.gz brdo-ffc8cab84b79857e46849ed80a6de89a03defc68.tar.bz2 |
#505528 by Damien Tournoud and Rob Loach: Ensure proper weight of JS files.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/common.inc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/includes/common.inc b/includes/common.inc index 348390e33..bc211bfeb 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -2793,6 +2793,10 @@ function drupal_add_js($data = NULL, $options = NULL) { // Preprocess can only be set if caching is enabled. $options['preprocess'] = $options['cache'] ? $options['preprocess'] : FALSE; + // Tweak the weight so that files of the same weight are included in the + // order of the calls to drupal_add_js(). + $options['weight'] += count($javascript) / 1000; + if (isset($data)) { // Add jquery.js and drupal.js, as well as the basePath setting, the // first time a Javascript file is added. |