Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Minor cleanup of text-style color defaults.

  • Loading branch information...
commit e354071741e750e5ae15e20b309df604338a7426 1 parent a2dd064
@dnschnur dnschnur authored
Showing with 15 additions and 5 deletions.
  1. +15 −5 jquery.flot.js
View
20 jquery.flot.js
@@ -34,16 +34,20 @@ Licensed under the MIT license.
// the actual Flot code
(function($) {
+ // Cache the prototype hasOwnProperty for faster access
+
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
+
// Add default styles for tick labels and other text
+ var STYLES = [
+ ".flot-tick-label {font-size:smaller;color:#545454;}"
+ ];
+
$(function() {
- $("head").prepend("<style id='flot-default-styles'>.flot-tick-label {font-size:smaller;color:#545454;}</style>");
+ $("head").prepend("<style id='flot-default-styles'>" + STYLES.join("") + "</style>");
});
- // Cache the prototype hasOwnProperty for faster access
-
- var hasOwnProperty = Object.prototype.hasOwnProperty;
-
///////////////////////////////////////////////////////////////////////////
// The Canvas object is a wrapper around an HTML5 <canvas> tag.
//
@@ -668,6 +672,9 @@ Licensed under the MIT license.
options.xaxes[i] = axisOptions;
if (axisOptions.font) {
axisOptions.font = $.extend({}, fontDefaults, axisOptions.font);
+ if (!axisOptions.font.color) {
+ axisOptions.font.color = axisOptions.color;
+ }
}
}
@@ -677,6 +684,9 @@ Licensed under the MIT license.
options.yaxes[i] = axisOptions;
if (axisOptions.font) {
axisOptions.font = $.extend({}, fontDefaults, axisOptions.font);
+ if (!axisOptions.font.color) {
+ axisOptions.font.color = axisOptions.color;
+ }
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.