Fixing initial color in color selector
parent
14e53ec76b
commit
8b5830a33f
|
@ -24,12 +24,11 @@ getDefaulColorList = taiga.getDefaulColorList
|
|||
class ColorSelectorController
|
||||
constructor: () ->
|
||||
@.colorList = getDefaulColorList()
|
||||
|
||||
if @.initColor
|
||||
@.color = @.initColor
|
||||
|
||||
@.displayColorList = false
|
||||
|
||||
setColor: (color) ->
|
||||
@.color = @.initColor
|
||||
|
||||
resetColor: () ->
|
||||
if @.isRequired and not @.color
|
||||
@.color = @.initColor
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
# File: color-selector.directive.coffee
|
||||
###
|
||||
|
||||
bindOnce = @.taiga.bindOnce
|
||||
|
||||
ColorSelectorDirective = ($timeout) ->
|
||||
link = (scope, el, attrs, ctrl) ->
|
||||
# Animation
|
||||
|
@ -42,6 +44,9 @@ ColorSelectorDirective = ($timeout) ->
|
|||
.mouseenter(cancel)
|
||||
.mouseleave(close)
|
||||
|
||||
bindOnce scope, 'vm.initColor', (color) ->
|
||||
ctrl.setColor(color)
|
||||
|
||||
return {
|
||||
link: link,
|
||||
templateUrl:"components/color-selector/color-selector.html",
|
||||
|
|
Loading…
Reference in New Issue