Merge pull request #464 from JelteF/escape-hover

Escape labels in hover
This commit is contained in:
Jelte Fennema 2014-10-15 13:58:05 +02:00
commit 1c66cfc4ac
2 changed files with 4 additions and 2 deletions

View file

@ -233,7 +233,8 @@ class Morris.Bar extends Morris.Grid
# @private
hoverContentForRow: (index) ->
row = @data[index]
content = "<div class='morris-hover-row-label'>#{row.label}</div>"
content = $("<div class='morris-hover-row-label'>").text(row.label)
content = content.prop('outerHTML')
for y, j in row.y
if @options.labels[j] is false
continue

View file

@ -107,7 +107,8 @@ class Morris.Line extends Morris.Grid
# @private
hoverContentForRow: (index) ->
row = @data[index]
content = "<div class='morris-hover-row-label'>#{row.label}</div>"
content = $("<div class='morris-hover-row-label'>").text(row.label)
content = content.prop('outerHTML')
for y, j in row.y
if @options.labels[j] is false
continue