Skip to content

Commit 8cde80e

Browse files
committed
chore(version): bump to v0.6.9
1 parent 9f54601 commit 8cde80e

File tree

9 files changed

+102
-52
lines changed

9 files changed

+102
-52
lines changed

.bmp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
version: 0.6.8
2+
version: 0.6.9
33
commit: 'chore(version): bump to v%.%.%'
44
files:
55
src/core.js: 'version: "%.%.%"'

c3.js

Lines changed: 45 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* @license C3.js v0.6.8 | (c) C3 Team and other contributors | http://c3js.org/ */
1+
/* @license C3.js v0.6.9 | (c) C3 Team and other contributors | http://c3js.org/ */
22
(function (global, factory) {
33
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
44
typeof define === 'function' && define.amd ? define(factory) :
@@ -1147,7 +1147,7 @@
11471147
};
11481148

11491149
var c3 = {
1150-
version: "0.6.8",
1150+
version: "0.6.9",
11511151
chart: {
11521152
fn: Chart.prototype,
11531153
internal: {
@@ -1449,10 +1449,12 @@
14491449
withUpdateOrgXDomain: true,
14501450
withTransitionForAxis: false
14511451
});
1452-
} // Bind resize event
1452+
} // Bind to resize event
14531453

14541454

1455-
$$.bindResize(); // export element of the chart
1455+
$$.bindResize(); // Bind to window focus event
1456+
1457+
$$.bindWindowFocus(); // export element of the chart
14561458

14571459
$$.api.element = $$.selectChart.node();
14581460
};
@@ -2095,6 +2097,10 @@
20952097
characterData: true
20962098
});
20972099
};
2100+
/**
2101+
* Binds handlers to the window resize event.
2102+
*/
2103+
20982104

20992105
ChartInternal.prototype.bindResize = function () {
21002106
var $$ = this,
@@ -2171,6 +2177,34 @@
21712177
};
21722178
}
21732179
};
2180+
/**
2181+
* Binds handlers to the window focus event.
2182+
*/
2183+
2184+
2185+
ChartInternal.prototype.bindWindowFocus = function () {
2186+
var _this = this;
2187+
2188+
if (this.windowFocusHandler) {
2189+
// The handler is already set
2190+
return;
2191+
}
2192+
2193+
this.windowFocusHandler = function () {
2194+
_this.redraw();
2195+
};
2196+
2197+
window.addEventListener('focus', this.windowFocusHandler);
2198+
};
2199+
/**
2200+
* Unbinds from the window focus event.
2201+
*/
2202+
2203+
2204+
ChartInternal.prototype.unbindWindowFocus = function () {
2205+
window.removeEventListener('focus', this.windowFocusHandler);
2206+
delete this.windowFocusHandler;
2207+
};
21742208

21752209
ChartInternal.prototype.generateResize = function () {
21762210
var resizeFunctions = [];
@@ -2265,20 +2299,7 @@
22652299
};
22662300

22672301
ChartInternal.prototype.isTabVisible = function () {
2268-
var hidden;
2269-
2270-
if (typeof document.hidden !== "undefined") {
2271-
// Opera 12.10 and Firefox 18 and later support
2272-
hidden = "hidden";
2273-
} else if (typeof document.mozHidden !== "undefined") {
2274-
hidden = "mozHidden";
2275-
} else if (typeof document.msHidden !== "undefined") {
2276-
hidden = "msHidden";
2277-
} else if (typeof document.webkitHidden !== "undefined") {
2278-
hidden = "webkitHidden";
2279-
}
2280-
2281-
return document[hidden] ? false : true;
2302+
return !document.hidden;
22822303
};
22832304

22842305
ChartInternal.prototype.getPathBox = getPathBox;
@@ -4258,10 +4279,12 @@
42584279
if (wrapper && wrapper.add && wrapper.remove) {
42594280
wrapper.remove($$.resizeFunction);
42604281
}
4261-
} // remove the inner resize functions
4282+
} // Removes the inner resize functions
4283+
42624284

4285+
$$.resizeFunction.remove(); // Unbinds from the window focus event
42634286

4264-
$$.resizeFunction.remove();
4287+
$$.unbindWindowFocus();
42654288
$$.selectChart.classed('c3', false).html(""); // MEMO: this is needed because the reference of some elements will not be released, then memory leak will happen.
42664289

42674290
Object.keys($$).forEach(function (key) {
@@ -4856,8 +4879,8 @@
48564879
classes,
48574880
regions;
48584881
options = options || {};
4859-
duration = $$.getOption(options, "duration", config.transition_duration);
4860-
classes = $$.getOption(options, "classes", [CLASS.region]);
4882+
duration = getOption(options, "duration", config.transition_duration);
4883+
classes = getOption(options, "classes", [CLASS.region]);
48614884
regions = $$.main.select('.' + CLASS.regions).selectAll(classes.map(function (c) {
48624885
return '.' + c;
48634886
}));

c3.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

component.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "c3",
33
"repo": "masayuki0812/c3",
44
"description": "A D3-based reusable chart library",
5-
"version": "0.6.8",
5+
"version": "0.6.9",
66
"keywords": [],
77
"dependencies": {
88
"mbostock/d3": "v5.0.0"

docs/index.html.haml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838

3939
%h3 Change Log
4040
%ul
41+
%li
42+
<a href="https://github.com/c3js/c3/releases/tag/v0.6.9">v0.6.9</a><span class="gray">&nbsp;-&nbsp;2018-11-22</span>
43+
%ul
44+
%li Fix a bug.
4145
%li
4246
<a href="https://github.com/c3js/c3/releases/tag/v0.6.8">v0.6.8</a><span class="gray">&nbsp;-&nbsp;2018-10-01</span>
4347
%ul

docs/js/c3.js

Lines changed: 45 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* @license C3.js v0.6.8 | (c) C3 Team and other contributors | http://c3js.org/ */
1+
/* @license C3.js v0.6.9 | (c) C3 Team and other contributors | http://c3js.org/ */
22
(function (global, factory) {
33
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
44
typeof define === 'function' && define.amd ? define(factory) :
@@ -1147,7 +1147,7 @@
11471147
};
11481148

11491149
var c3 = {
1150-
version: "0.6.8",
1150+
version: "0.6.9",
11511151
chart: {
11521152
fn: Chart.prototype,
11531153
internal: {
@@ -1449,10 +1449,12 @@
14491449
withUpdateOrgXDomain: true,
14501450
withTransitionForAxis: false
14511451
});
1452-
} // Bind resize event
1452+
} // Bind to resize event
14531453

14541454

1455-
$$.bindResize(); // export element of the chart
1455+
$$.bindResize(); // Bind to window focus event
1456+
1457+
$$.bindWindowFocus(); // export element of the chart
14561458

14571459
$$.api.element = $$.selectChart.node();
14581460
};
@@ -2095,6 +2097,10 @@
20952097
characterData: true
20962098
});
20972099
};
2100+
/**
2101+
* Binds handlers to the window resize event.
2102+
*/
2103+
20982104

20992105
ChartInternal.prototype.bindResize = function () {
21002106
var $$ = this,
@@ -2171,6 +2177,34 @@
21712177
};
21722178
}
21732179
};
2180+
/**
2181+
* Binds handlers to the window focus event.
2182+
*/
2183+
2184+
2185+
ChartInternal.prototype.bindWindowFocus = function () {
2186+
var _this = this;
2187+
2188+
if (this.windowFocusHandler) {
2189+
// The handler is already set
2190+
return;
2191+
}
2192+
2193+
this.windowFocusHandler = function () {
2194+
_this.redraw();
2195+
};
2196+
2197+
window.addEventListener('focus', this.windowFocusHandler);
2198+
};
2199+
/**
2200+
* Unbinds from the window focus event.
2201+
*/
2202+
2203+
2204+
ChartInternal.prototype.unbindWindowFocus = function () {
2205+
window.removeEventListener('focus', this.windowFocusHandler);
2206+
delete this.windowFocusHandler;
2207+
};
21742208

21752209
ChartInternal.prototype.generateResize = function () {
21762210
var resizeFunctions = [];
@@ -2265,20 +2299,7 @@
22652299
};
22662300

22672301
ChartInternal.prototype.isTabVisible = function () {
2268-
var hidden;
2269-
2270-
if (typeof document.hidden !== "undefined") {
2271-
// Opera 12.10 and Firefox 18 and later support
2272-
hidden = "hidden";
2273-
} else if (typeof document.mozHidden !== "undefined") {
2274-
hidden = "mozHidden";
2275-
} else if (typeof document.msHidden !== "undefined") {
2276-
hidden = "msHidden";
2277-
} else if (typeof document.webkitHidden !== "undefined") {
2278-
hidden = "webkitHidden";
2279-
}
2280-
2281-
return document[hidden] ? false : true;
2302+
return !document.hidden;
22822303
};
22832304

22842305
ChartInternal.prototype.getPathBox = getPathBox;
@@ -4258,10 +4279,12 @@
42584279
if (wrapper && wrapper.add && wrapper.remove) {
42594280
wrapper.remove($$.resizeFunction);
42604281
}
4261-
} // remove the inner resize functions
4282+
} // Removes the inner resize functions
4283+
42624284

4285+
$$.resizeFunction.remove(); // Unbinds from the window focus event
42634286

4264-
$$.resizeFunction.remove();
4287+
$$.unbindWindowFocus();
42654288
$$.selectChart.classed('c3', false).html(""); // MEMO: this is needed because the reference of some elements will not be released, then memory leak will happen.
42664289

42674290
Object.keys($$).forEach(function (key) {
@@ -4856,8 +4879,8 @@
48564879
classes,
48574880
regions;
48584881
options = options || {};
4859-
duration = $$.getOption(options, "duration", config.transition_duration);
4860-
classes = $$.getOption(options, "classes", [CLASS.region]);
4882+
duration = getOption(options, "duration", config.transition_duration);
4883+
classes = getOption(options, "classes", [CLASS.region]);
48614884
regions = $$.main.select('.' + CLASS.regions).selectAll(classes.map(function (c) {
48624885
return '.' + c;
48634886
}));

docs/js/c3.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "c3",
3-
"version": "0.6.8",
3+
"version": "0.6.9",
44
"description": "D3-based reusable chart library",
55
"main": "c3.js",
66
"files": [

src/core.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
} from './util';
2121

2222
var c3 = {
23-
version: "0.6.8",
23+
version: "0.6.9",
2424
chart: {
2525
fn: Chart.prototype,
2626
internal: {

0 commit comments

Comments
 (0)