mirror of
https://github.com/morrisjs/morris.js.git
synced 2024-11-10 21:36:34 +01:00
Clone @default options object before merging it
This commit is contained in:
parent
8d6cb3ee8e
commit
d059c3acaf
@ -9,7 +9,7 @@ class Morris.Line
|
||||
if not (this instanceof Morris.Line)
|
||||
return new Morris.Line(options)
|
||||
@el = $ document.getElementById(options.element)
|
||||
@options = $.extend @defaults, options
|
||||
@options = $.extend $.extend({}, @defaults), options
|
||||
# bail if there's no data
|
||||
if @options.data is undefined or @options.data.length is 0
|
||||
return
|
||||
|
@ -8,7 +8,7 @@
|
||||
function Line(options) {
|
||||
if (!(this instanceof Morris.Line)) return new Morris.Line(options);
|
||||
this.el = $(document.getElementById(options.element));
|
||||
this.options = $.extend(this.defaults, options);
|
||||
this.options = $.extend($.extend({}, this.defaults), options);
|
||||
if (this.options.data === void 0 || this.options.data.length === 0) return;
|
||||
this.el.addClass('graph-initialised');
|
||||
this.precalc();
|
||||
|
2
morris.min.js
vendored
2
morris.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user