Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
c3-closed
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Evgeny
c3-closed
Commits
22fcf44d
Commit
22fcf44d
authored
Jun 06, 2015
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #860 from denisvmedia/master
Calling resize on each and every window resize drammatically slows down the browser
parents
ae26e98e
6e974710
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
config.js
src/config.js
+1
-0
core.js
src/core.js
+11
-3
No files found.
src/config.js
View file @
22fcf44d
...
...
@@ -7,6 +7,7 @@ c3_chart_internal_fn.getDefaultConfig = function () {
padding_right
:
undefined
,
padding_top
:
undefined
,
padding_bottom
:
undefined
,
resize_auto
:
true
,
zoom_enabled
:
false
,
zoom_extent
:
undefined
,
zoom_privileged
:
false
,
...
...
src/core.js
View file @
22fcf44d
...
...
@@ -324,12 +324,20 @@ c3_chart_internal_fn.initWithData = function (data) {
window
.
onresize
=
$$
.
generateResize
();
}
if
(
window
.
onresize
.
add
)
{
var
timeout
;
window
.
onresize
.
add
(
function
()
{
config
.
onresize
.
call
(
$$
);
});
window
.
onresize
.
add
(
function
()
{
$$
.
api
.
flush
();
});
if
(
config
.
resize_auto
)
{
window
.
onresize
.
add
(
function
()
{
if
(
timeout
!==
undefined
)
{
clearTimeout
(
timeout
);
}
timeout
=
setTimeout
(
function
()
{
$$
.
api
.
flush
();
},
100
);
});
}
window
.
onresize
.
add
(
function
()
{
config
.
onresized
.
call
(
$$
);
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment