diff options
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. |