Skip to content

Commit

Permalink
Add comment and desired structure to colors patch
Browse files Browse the repository at this point in the history
Per request from dnschnur (flot/flot#1034 (comment)), I have: 
- Added a comment explaining the purpose of the new check/override
- Changed the structure to match preferred standard structure
  • Loading branch information
BrendanFDMoore committed Mar 16, 2016
1 parent 50a8540 commit 62a30e5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion jquery.flot.js
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,11 @@ Licensed under the MIT license.

$.extend(true, options, opts);

if (opts.colors) options.colors = opts.colors;
//Override options.colors after $.extend if user has set colors, because extend does not clear out excess
//default colors if user defines color palette smaller than default palette size (currently 5).
if (opts.colors) {
options.colors = opts.colors;
}

if (options.xaxis.color == null)
options.xaxis.color = $.color.parse(options.grid.color).scale('a', 0.22).toString();
Expand Down

0 comments on commit 62a30e5

Please sign in to comment.