File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -74,12 +74,12 @@ function theme_flot_graph($variables) {
74
74
75
75
$json_data = function_exists('json_encode') ? json_encode($data) : drupal_json_encode($data);
76
76
$json_options = function_exists('json_encode') ? json_encode($options) : drupal_json_encode($options);
77
- $data = "if (Drupal.jsEnabled ) {
77
+ $data = "(function ($ ) {
78
78
$(document).ready(function() {
79
79
Drupal.flot.{$id} = $.plot($('#{$element['id']}'), {$json_data}, {$json_options});
80
80
{$extra}
81
81
});
82
- }";
82
+ })(jQuery); ";
83
83
drupal_add_js($data, array('type' => 'inline', 'scope' => JS_DEFAULT));
84
84
}
85
85
return '<div ' . drupal_attributes($element) . '> </div>';
@@ -102,7 +102,7 @@ function flot_add_js() {
102
102
$excanvas = file_exists("{$path}/excanvas.min.js") ? "{$path}/excanvas.min.js" : "{$path}/excanvas.pack.js";
103
103
drupal_add_html_head('<!--[if IE]><script language="javascript" type="text/javascript" src="' . base_path() . $excanvas . '"></script><![endif]-->', $key = NULL /* TODO Set this variable. */);
104
104
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));
106
106
107
107
$added = true;
108
108
}
You can’t perform that action at this time.
0 commit comments