mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
fixed delete account validation
not using angular equals which does not seem to work
This commit is contained in:
parent
552cd5ddd4
commit
9354d61aa3
2 changed files with 10 additions and 5 deletions
|
@ -146,16 +146,16 @@ block content
|
|||
input.form-control(
|
||||
type="text",
|
||||
placeholder="",
|
||||
ng-model="deleteConfirmationText",
|
||||
equals="DELETE",
|
||||
focus-on="open"
|
||||
ng-model="state.deleteText",
|
||||
focus-on="open",
|
||||
ng-keyup="checkValidation()"
|
||||
)
|
||||
.modal-footer
|
||||
button.btn.btn-default(
|
||||
ng-click="cancel()"
|
||||
) Cancel
|
||||
button.btn.btn-danger(
|
||||
ng-disabled="deleteAccountForm.$invalid || state.inflight"
|
||||
ng-disabled="!state.isValid || state.inflight"
|
||||
ng-click="delete()"
|
||||
)
|
||||
span(ng-hide="state.inflight") Delete
|
||||
|
|
|
@ -29,6 +29,8 @@ define [
|
|||
"$scope", "$modalInstance", "$timeout", "$http",
|
||||
($scope, $modalInstance, $timeout, $http) ->
|
||||
$scope.state =
|
||||
isValid : false
|
||||
deleteText: ""
|
||||
inflight: false
|
||||
|
||||
$modalInstance.opened.then () ->
|
||||
|
@ -36,6 +38,9 @@ define [
|
|||
$scope.$broadcast "open"
|
||||
, 700
|
||||
|
||||
$scope.checkValidation = ->
|
||||
$scope.state.isValid = $scope.state.deleteText == "DELETE"
|
||||
|
||||
$scope.delete = () ->
|
||||
$scope.state.inflight = true
|
||||
|
||||
|
|
Loading…
Reference in a new issue