From 75835ecf9e0da62f2c61ffbe59dcd74ee210b9ed Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 1 Jun 2014 01:52:14 +0200 Subject: [PATCH] Scroll to top on error. --- app/scripts/directives/nodeForm.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/scripts/directives/nodeForm.js b/app/scripts/directives/nodeForm.js index db7db32..2ee6c41 100644 --- a/app/scripts/directives/nodeForm.js +++ b/app/scripts/directives/nodeForm.js @@ -2,7 +2,7 @@ angular.module('ffffng') .directive('fNodeForm', function () { - var ctrl = function ($scope, $timeout, Constraints, Validator, _, config) { + var ctrl = function ($scope, $timeout, Constraints, Validator, _, config, $window) { $scope.config = config; angular.extend($scope, { center: { @@ -107,6 +107,7 @@ angular.module('ffffng') default: $scope.error = 'Es ist ein Fehler aufgetreten. Versuche es später noch einmal.'; } + $window.scrollTo(0, 0); }); };