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
charts
c3-closed
Commits
d0d586b3
Commit
d0d586b3
authored
Nov 12, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Escape special characters for class suffix - #665
parent
5d107636
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
2 deletions
+9
-2
c3.js
c3.js
+1
-1
c3.min.js
c3.min.js
+0
-0
class-spec.js
spec/class-spec.js
+7
-0
class.js
src/class.js
+1
-1
No files found.
c3.js
View file @
d0d586b3
...
...
@@ -5490,7 +5490,7 @@
return
CLASS
.
chartArc
+
this
.
classTarget
(
d
.
data
.
id
);
};
c3_chart_internal_fn
.
getTargetSelectorSuffix
=
function
(
targetId
)
{
return
targetId
||
targetId
===
0
?
(
'-'
+
targetId
).
replace
(
/
\s
/g
,
'-'
)
:
''
;
return
targetId
||
targetId
===
0
?
(
'-'
+
targetId
).
replace
(
/
[\s
!@#$%^&*()_+,<>
]
/g
,
'-'
)
:
''
;
};
c3_chart_internal_fn
.
selectorTarget
=
function
(
id
,
prefix
)
{
return
(
prefix
||
''
)
+
'.'
+
CLASS
.
target
+
this
.
getTargetSelectorSuffix
(
id
);
...
...
c3.min.js
View file @
d0d586b3
This source diff could not be displayed because it is too large. You can
view the blob
instead.
spec/class-spec.js
View file @
d0d586b3
...
...
@@ -46,6 +46,13 @@ describe('c3 chart class', function () {
expect
(
suffix
).
toBe
(
expected
);
});
it
(
'should replace special charactors to "-"'
,
function
()
{
var
input
=
'data1 !@#$%^&*()_+,<>'
,
expected
=
'-data1----------------'
,
suffix
=
chart
.
internal
.
getTargetSelectorSuffix
(
input
);
expect
(
suffix
).
toBe
(
expected
);
});
});
describe
(
'multibyte characters on chart'
,
function
()
{
...
...
src/class.js
View file @
d0d586b3
...
...
@@ -155,7 +155,7 @@ c3_chart_internal_fn.classChartArc = function (d) {
return
CLASS
.
chartArc
+
this
.
classTarget
(
d
.
data
.
id
);
};
c3_chart_internal_fn
.
getTargetSelectorSuffix
=
function
(
targetId
)
{
return
targetId
||
targetId
===
0
?
(
'-'
+
targetId
).
replace
(
/
\s
/g
,
'-'
)
:
''
;
return
targetId
||
targetId
===
0
?
(
'-'
+
targetId
).
replace
(
/
[\s
!@#$%^&*()_+,<>
]
/g
,
'-'
)
:
''
;
};
c3_chart_internal_fn
.
selectorTarget
=
function
(
id
,
prefix
)
{
return
(
prefix
||
''
)
+
'.'
+
CLASS
.
target
+
this
.
getTargetSelectorSuffix
(
id
);
...
...
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