diff options
| author | Raphael Collet <rco@openerp.com> | 2012-09-26 11:50:04 +0200 |
|---|---|---|
| committer | Raphael Collet <rco@openerp.com> | 2012-09-26 11:50:04 +0200 |
| commit | c8d64b61d7a2ae5fe43c2081579158fb2dec60ec (patch) | |
| tree | 38d5bce999660f12a0ae0db60f0de27d7e1d4fb7 /addons/web/static/src/js/chrome.js | |
| parent | 8b80c8fdb25d1b853329672ee58abda3f435288d (diff) | |
[IMP] web: add methods show_error() and hide_error() in instance.web.Login
bzr revid: rco@openerp.com-20120926095004-bl7xsg9d376uhwop
Diffstat (limited to 'addons/web/static/src/js/chrome.js')
| -rw-r--r-- | addons/web/static/src/js/chrome.js | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index b4ba5404a49..e9185429993 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -579,7 +579,7 @@ instance.web.Login = instance.web.Widget.extend({ */ do_login: function (db, login, password) { var self = this; - this.$el.removeClass('oe_login_invalid'); + self.hide_error(); self.$(".oe_login_pane").fadeOut("slow"); return this.session.session_authenticate(db, login, password).pipe(function() { if (self.has_local_storage) { @@ -596,12 +596,19 @@ instance.web.Login = instance.web.Widget.extend({ } } self.trigger('login_successful'); - },function () { + }, function () { self.$(".oe_login_pane").fadeIn("fast", function() { - self.$el.addClass("oe_login_invalid"); + self.show_error("Invalid username or password"); }); }); }, + show_error: function(message) { + this.$el.addClass("oe_login_invalid"); + this.$(".oe_login_error_message").text(message); + }, + hide_error: function() { + this.$el.removeClass('oe_login_invalid'); + }, }); instance.web.client_actions.add("login", "instance.web.Login"); |
