diff --git a/webadmin/src/views/support.html b/webadmin/src/views/support.html index d5b503a87..5c8a142da 100644 --- a/webadmin/src/views/support.html +++ b/webadmin/src/views/support.html @@ -27,16 +27,16 @@ We would love to hear any ideas, feature requests and overall feedback from your side.

-
-
- - + +
+
-
- - +
+
- + + {{feedback.error}} + Thank You!
@@ -53,19 +53,23 @@ If you found any issue or bugs, let us know, we will resolve that for you as soon as possible.

-
-
- - + +
+
-
- - +
+
- + + {{ticket.error}} + Thank You!
- \ No newline at end of file + + +
+
+
diff --git a/webadmin/src/views/support.js b/webadmin/src/views/support.js index 56098bc58..2fddfc71b 100644 --- a/webadmin/src/views/support.js +++ b/webadmin/src/views/support.js @@ -2,11 +2,11 @@ angular.module('Application').controller('SupportController', ['$scope', '$location', 'Client', function ($scope, $location, Client) { - $scope.busy = false; $scope.feedback = { error: null, success: false, + busy: false, subject: '', description: '' }; @@ -14,12 +14,29 @@ angular.module('Application').controller('SupportController', ['$scope', '$locat $scope.ticket = { error: null, success: false, + busy: false, subject: '', description: '' }; + function resetFeedback() { + $scope.feedback.subject = ''; + $scope.feedback.description = ''; + + $scope.feedbackForm.$setUntouched(); + $scope.feedbackForm.$setPristine(); + } + + function resetTicket() { + $scope.ticket.subject = ''; + $scope.ticket.description = ''; + + $scope.ticketForm.$setUntouched(); + $scope.ticketForm.$setPristine(); + } + $scope.submitFeedback = function () { - $scope.busy = true; + $scope.feedback.busy = true; $scope.feedback.success = false; $scope.feedback.error = null; @@ -28,14 +45,15 @@ angular.module('Application').controller('SupportController', ['$scope', '$locat $scope.feedback.error = error; } else { $scope.feedback.success = true; + resetFeedback(); } - $scope.busy = false; + $scope.feedback.busy = false; }); }; $scope.submitTicket = function () { - $scope.busy = true; + $scope.ticket.busy = true; $scope.ticket.success = false; $scope.ticket.error = null; @@ -44,9 +62,10 @@ angular.module('Application').controller('SupportController', ['$scope', '$locat $scope.ticket.error = error; } else { $scope.ticket.success = true; + resetTicket(); } - $scope.busy = false; + $scope.ticket.busy = false; }); }; }]);