Support a default value when undefined in the review panel toggles.

This commit is contained in:
Paulo Reis 2017-07-04 11:15:24 +01:00
parent 97b47b496a
commit 310a1341a1

View file

@ -6,6 +6,7 @@ define [
scope:
onToggle: '&'
ngModel: '='
valWhenUndefined: '=?'
disabled: '=?'
onDisabledClick: '=?'
link: (scope) ->
@ -18,6 +19,8 @@ define [
scope.onDisabledClick()
scope.localModel = scope.ngModel
scope.$watch "ngModel", (value) ->
if scope.valWhenUndefined? and !value?
value = scope.valWhenUndefined
scope.localModel = value
template: """