autofilled fields do not trigger model update, do it manually

This commit is contained in:
Athou
2014-08-13 02:51:53 +02:00
parent 9888e23cd9
commit 27d16265d6

View File

@@ -1460,7 +1460,8 @@ module.controller('MetricsCtrl', ['$scope', 'AdminMetricsService', function($sco
$scope.metrics = AdminMetricsService.get(); $scope.metrics = AdminMetricsService.get();
}]); }]);
module.controller('LoginCtrl', ['$scope', '$location', 'SessionService', 'ServerService', function($scope, $location, SessionService, ServerService) { module.controller('LoginCtrl', ['$scope', '$location', '$timeout', 'SessionService', 'ServerService',
function($scope, $location, $timeout, SessionService, ServerService) {
$scope.model = {}; $scope.model = {};
$scope.recovery_model = {}; $scope.recovery_model = {};
$scope.recovery = false; $scope.recovery = false;
@@ -1470,6 +1471,11 @@ module.controller('LoginCtrl', ['$scope', '$location', 'SessionService', 'Server
$scope.recovery_enabled = data.smtpEnabled; $scope.recovery_enabled = data.smtpEnabled;
}); });
// autofilled fields do not trigger model update, do it manually
$timeout(function() {
$('input[ng-model]').trigger('input');
}, 100);
var login = function(model) { var login = function(model) {
var success = function(data) { var success = function(data) {
window.location.href = window.location.href.substring(0, window.location.href.lastIndexOf('#')); window.location.href = window.location.href.substring(0, window.location.href.lastIndexOf('#'));
@@ -1508,7 +1514,7 @@ module.controller('LoginCtrl', ['$scope', '$location', 'SessionService', 'Server
email : $scope.recovery_model.email email : $scope.recovery_model.email
}, recovery_success, recovery_error); }, recovery_success, recovery_error);
} }
}]); }]);
module.controller('RegisterCtrl', ['$scope', '$location', 'SessionService', 'ServerService', module.controller('RegisterCtrl', ['$scope', '$location', 'SessionService', 'ServerService',
function($scope, $location, SessionService, ServerService) { function($scope, $location, SessionService, ServerService) {