mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Support a default value when undefined in the review panel toggles.
This commit is contained in:
parent
97b47b496a
commit
310a1341a1
1 changed files with 3 additions and 0 deletions
|
@ -6,6 +6,7 @@ define [
|
||||||
scope:
|
scope:
|
||||||
onToggle: '&'
|
onToggle: '&'
|
||||||
ngModel: '='
|
ngModel: '='
|
||||||
|
valWhenUndefined: '=?'
|
||||||
disabled: '=?'
|
disabled: '=?'
|
||||||
onDisabledClick: '=?'
|
onDisabledClick: '=?'
|
||||||
link: (scope) ->
|
link: (scope) ->
|
||||||
|
@ -18,6 +19,8 @@ define [
|
||||||
scope.onDisabledClick()
|
scope.onDisabledClick()
|
||||||
scope.localModel = scope.ngModel
|
scope.localModel = scope.ngModel
|
||||||
scope.$watch "ngModel", (value) ->
|
scope.$watch "ngModel", (value) ->
|
||||||
|
if scope.valWhenUndefined? and !value?
|
||||||
|
value = scope.valWhenUndefined
|
||||||
scope.localModel = value
|
scope.localModel = value
|
||||||
|
|
||||||
template: """
|
template: """
|
||||||
|
|
Loading…
Reference in a new issue