Commit c0482d99 authored by sun's avatar sun
Browse files

#503848 by Gábor Hojtsy: Added default weight of JS_LIBRARY for JavaScripts.

parent c20e2279
......@@ -6,6 +6,7 @@ jQuery UI x.x-x.x, xxxx-xx-xx
jQuery UI 7.x-1.x, xxxx-xx-xx
-----------------------------
#503848 by Gbor Hojtsy: Added default weight of JS_LIBRARY for JavaScripts.
#325831 by quicksketch, James Andres, ksenzee: Fixed drupal_get_path() fails
during Drupal installation.
#357780 by Gbor Hojtsy: Ported to 7.x.
......
......@@ -35,7 +35,7 @@ else {
* on the page, or a string with a single file name.
*/
function jquery_ui_add($files = array()) {
static $loaded_files, $ui_core, $effects_core;
static $loaded_files, $ui_core, $effects_core, $weight;
$jquery_ui_path = JQUERY_UI_PATH . '/ui';
$compression = variable_get('jquery_update_compression_type', 'mini');
......@@ -45,6 +45,10 @@ function jquery_ui_add($files = array()) {
$files = array($files);
}
if (!isset($weight)) {
$weight = JS_LIBRARY + 5;
}
// If core hasn't been added yet, add it.
if (!isset($ui_core)) {
$ui_core = TRUE;
......@@ -76,7 +80,7 @@ function jquery_ui_add($files = array()) {
break;
}
$js_path = $jquery_ui_path . '/' . $file_path;
drupal_add_js($js_path);
drupal_add_js($js_path, array('weight' => $weight++));
$loaded_files[$file] = $js_path;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment