Add preventDefault() on click event

This commit is contained in:
Patrick Perey 2014-03-07 10:46:27 -08:00
parent 70ff31d69f
commit 91156b6f0c
1 changed files with 3 additions and 1 deletions

View File

@ -111,7 +111,9 @@ paintIt = (element, backgroundColor, textColor) ->
element.style.color = textColor
$ ->
$("a[data-background-color]").click ->
$("a[data-background-color]").click (e) ->
e.preventDefault()
backgroundColor = $(this).data("background-color")
textColor = $(this).data("text-color")
paintIt(this, backgroundColor, textColor)