Skip to content

Commit b84631e

Browse files
committed
fix js
1 parent 3698e35 commit b84631e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

flot.module

+3-3
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,12 @@ function theme_flot_graph($variables) {
7474

7575
$json_data = function_exists('json_encode') ? json_encode($data) : drupal_json_encode($data);
7676
$json_options = function_exists('json_encode') ? json_encode($options) : drupal_json_encode($options);
77-
$data = "if (Drupal.jsEnabled) {
77+
$data = "(function ($) {
7878
$(document).ready(function() {
7979
Drupal.flot.{$id} = $.plot($('#{$element['id']}'), {$json_data}, {$json_options});
8080
{$extra}
8181
});
82-
}";
82+
})(jQuery);";
8383
drupal_add_js($data, array('type' => 'inline', 'scope' => JS_DEFAULT));
8484
}
8585
return '<div ' . drupal_attributes($element) . '> </div>';
@@ -102,7 +102,7 @@ function flot_add_js() {
102102
$excanvas = file_exists("{$path}/excanvas.min.js") ? "{$path}/excanvas.min.js" : "{$path}/excanvas.pack.js";
103103
drupal_add_html_head('<!--[if IE]><script language="javascript" type="text/javascript" src="' . base_path() . $excanvas . '"></script><![endif]-->', $key = NULL /* TODO Set this variable. */);
104104
drupal_add_js($path . '/jquery.flot.js');
105-
drupal_add_js('if (Drupal.jsEnabled) { Drupal.flot = {}; }', array('type' => 'inline', 'scope' => JS_DEFAULT));
105+
drupal_add_js('(function ($) { Drupal.flot = Drupal.flot || {}; })(jQuery);', array('type' => 'inline', 'scope' => JS_DEFAULT));
106106

107107
$added = true;
108108
}

0 commit comments

Comments
 (0)