Prevent event propagation when press ENTER in the color selector

stable
David Barragán Merino 2016-09-21 13:40:25 +02:00
parent 5e6d29b609
commit 2c6db751aa
1 changed files with 2 additions and 2 deletions

View File

@ -29,7 +29,7 @@ class ColorSelectorController
checkIsColorRequired: () ->
if !@.isColorRequired
@.colorList = _.dropRight(@.colorList);
@.colorList = _.dropRight(@.colorList)
setColor: (color) ->
@.color = @.initColor
@ -49,9 +49,9 @@ class ColorSelectorController
onKeyDown: (event) ->
if event.which == 13 # ENTER
event.stopPropagation()
if @.color or not @.isColorRequired
@.onSelectDropdownColor(@.color)
event.preventDefault()
angular.module('taigaComponents').controller("ColorSelectorCtrl", ColorSelectorController)