Skip to content

Commit

Permalink
0.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
weizhenye committed Oct 29, 2016
1 parent b9c4b92 commit 70951e3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
28 changes: 23 additions & 5 deletions dist/vue-highcharts.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,28 @@ var ctors = {
'highcharts-renderer': 'Renderer'
};

/* istanbul ignore next */
function clone(obj) {
var copy;
if (obj === null || typeof obj !== 'object') {
return obj;
}
if (obj instanceof Array) {
copy = [];
for (var i = obj.length - 1; i >= 0; i--) {
copy[i] = clone(obj[i]);
}
return copy;
}
if (obj instanceof Object) {
copy = {};
for (var key in obj) {
copy[key] = clone(obj[key]);
}
return copy;
}
}

function create(tagName, Highcharts) {
var Ctor = Highcharts[ctors[tagName]];
if (!Ctor) {
Expand Down Expand Up @@ -43,11 +65,7 @@ function create(tagName, Highcharts) {
this.renderer && this.$el.removeChild(this.renderer.box);
this.renderer = new Ctor(this.$el, this.width, this.height);
} else {
var opts = {};
for (var property in this.options) {
opts[property] = this.options[property];
}
this.chart = new Ctor(this.$el, opts);
this.chart = new Ctor(this.$el, clone(this.options));
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion dist/vue-highcharts.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-highcharts",
"version": "0.0.6",
"version": "0.0.7",
"description": "Highcharts component for Vue",
"main": "dist/vue-highcharts.js",
"jsnext:main": "src/index.js",
Expand Down

0 comments on commit 70951e3

Please sign in to comment.