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 8e6265e3d2
commit c701711eab

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: """