Browse Source

Remove resize_timeout option

pull/1207/head
Masayuki Tanaka 10 years ago
parent
commit
f8f7255ad1
  1. 17
      c3.js
  2. 4
      c3.min.js
  3. 1
      src/config.js
  4. 16
      src/core.js

17
c3.js

@ -931,17 +931,13 @@
});
if (config.resize_auto) {
$$.resizeFunction.add(function () {
if (config.resize_timeout) {
if ($$.resizeTimeout !== undefined) {
window.clearTimeout($$.resizeTimeout);
}
$$.resizeTimeout = window.setTimeout(function () {
delete $$.resizeTimeout;
$$.api.flush();
}, config.resize_timeout);
} else {
$$.api.flush();
if ($$.resizeTimeout !== undefined) {
window.clearTimeout($$.resizeTimeout);
}
$$.resizeTimeout = window.setTimeout(function () {
delete $$.resizeTimeout;
$$.api.flush();
}, 100);
});
}
$$.resizeFunction.add(function () {
@ -1066,7 +1062,6 @@
padding_top: undefined,
padding_bottom: undefined,
resize_auto: true,
resize_timeout: 100,
zoom_enabled: false,
zoom_extent: undefined,
zoom_privileged: false,

4
c3.min.js vendored

File diff suppressed because one or more lines are too long

1
src/config.js

@ -8,7 +8,6 @@ c3_chart_internal_fn.getDefaultConfig = function () {
padding_top: undefined,
padding_bottom: undefined,
resize_auto: true,
resize_timeout: 100,
zoom_enabled: false,
zoom_extent: undefined,
zoom_privileged: false,

16
src/core.js

@ -926,17 +926,13 @@ c3_chart_internal_fn.bindResize = function () {
});
if (config.resize_auto) {
$$.resizeFunction.add(function () {
if (config.resize_timeout) {
if ($$.resizeTimeout !== undefined) {
window.clearTimeout($$.resizeTimeout);
}
$$.resizeTimeout = window.setTimeout(function () {
delete $$.resizeTimeout;
$$.api.flush();
}, config.resize_timeout);
} else {
$$.api.flush();
if ($$.resizeTimeout !== undefined) {
window.clearTimeout($$.resizeTimeout);
}
$$.resizeTimeout = window.setTimeout(function () {
delete $$.resizeTimeout;
$$.api.flush();
}, 100);
});
}
$$.resizeFunction.add(function () {

Loading…
Cancel
Save