mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
autofilled fields do not trigger model update, do it manually
This commit is contained in:
@@ -1460,55 +1460,61 @@ 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',
|
||||||
$scope.model = {};
|
function($scope, $location, $timeout, SessionService, ServerService) {
|
||||||
$scope.recovery_model = {};
|
$scope.model = {};
|
||||||
$scope.recovery = false;
|
$scope.recovery_model = {};
|
||||||
$scope.recovery_enabled = false;
|
$scope.recovery = false;
|
||||||
|
$scope.recovery_enabled = false;
|
||||||
ServerService.get(function(data) {
|
|
||||||
$scope.recovery_enabled = data.smtpEnabled;
|
|
||||||
});
|
|
||||||
|
|
||||||
var login = function(model) {
|
|
||||||
var success = function(data) {
|
|
||||||
window.location.href = window.location.href.substring(0, window.location.href.lastIndexOf('#'));
|
|
||||||
};
|
|
||||||
var error = function(data) {
|
|
||||||
$scope.message = data.data;
|
|
||||||
};
|
|
||||||
SessionService.login({
|
|
||||||
name : model.name,
|
|
||||||
password : model.password
|
|
||||||
}, success, error);
|
|
||||||
}
|
|
||||||
$scope.demoLogin = function() {
|
|
||||||
login({
|
|
||||||
name : 'demo',
|
|
||||||
password : 'demo'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
$scope.login = function() {
|
ServerService.get(function(data) {
|
||||||
login($scope.model);
|
$scope.recovery_enabled = data.smtpEnabled;
|
||||||
};
|
});
|
||||||
|
|
||||||
$scope.toggleRecovery = function() {
|
// autofilled fields do not trigger model update, do it manually
|
||||||
$scope.recovery = !$scope.recovery;
|
$timeout(function() {
|
||||||
};
|
$('input[ng-model]').trigger('input');
|
||||||
|
}, 100);
|
||||||
var recovery_success = function(data) {
|
|
||||||
$scope.recovery_message = "Email has ben sent. Check your inbox.";
|
var login = function(model) {
|
||||||
};
|
var success = function(data) {
|
||||||
var recovery_error = function(data) {
|
window.location.href = window.location.href.substring(0, window.location.href.lastIndexOf('#'));
|
||||||
$scope.recovery_message = data.data;
|
};
|
||||||
};
|
var error = function(data) {
|
||||||
$scope.recover = function() {
|
$scope.message = data.data;
|
||||||
SessionService.passwordReset({
|
};
|
||||||
email : $scope.recovery_model.email
|
SessionService.login({
|
||||||
}, recovery_success, recovery_error);
|
name : model.name,
|
||||||
}
|
password : model.password
|
||||||
}]);
|
}, success, error);
|
||||||
|
}
|
||||||
|
$scope.demoLogin = function() {
|
||||||
|
login({
|
||||||
|
name : 'demo',
|
||||||
|
password : 'demo'
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.login = function() {
|
||||||
|
login($scope.model);
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.toggleRecovery = function() {
|
||||||
|
$scope.recovery = !$scope.recovery;
|
||||||
|
};
|
||||||
|
|
||||||
|
var recovery_success = function(data) {
|
||||||
|
$scope.recovery_message = "Email has ben sent. Check your inbox.";
|
||||||
|
};
|
||||||
|
var recovery_error = function(data) {
|
||||||
|
$scope.recovery_message = data.data;
|
||||||
|
};
|
||||||
|
$scope.recover = function() {
|
||||||
|
SessionService.passwordReset({
|
||||||
|
email : $scope.recovery_model.email
|
||||||
|
}, 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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user