diff options
| author | Rajesh Prajapati (OpenERP) <rpr@tinyerp.com> | 2012-10-05 17:35:03 +0530 |
|---|---|---|
| committer | Rajesh Prajapati (OpenERP) <rpr@tinyerp.com> | 2012-10-05 17:35:03 +0530 |
| commit | cdff4611b0a588546afb9b706bbd2d0fbda7bf2f (patch) | |
| tree | 0a0a99b33e52547987ab69b2a29f3ec23c188142 /addons/auth_oauth/static/src/js/auth_oauth.js | |
| parent | 7202b8f7efbc76e2a40b1a4a8d7a95ed0d2ce573 (diff) | |
| parent | ba97319054728490e4d8a601382dd6fd2ab4f970 (diff) | |
[MERGE] merge with main addons
bzr revid: rpr@tinyerp.com-20121005120503-07e0zo8ucv8k0q3s
Diffstat (limited to 'addons/auth_oauth/static/src/js/auth_oauth.js')
| -rw-r--r-- | addons/auth_oauth/static/src/js/auth_oauth.js | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/addons/auth_oauth/static/src/js/auth_oauth.js b/addons/auth_oauth/static/src/js/auth_oauth.js index 4a41e720726..5c80d29f4e9 100644 --- a/addons/auth_oauth/static/src/js/auth_oauth.js +++ b/addons/auth_oauth/static/src/js/auth_oauth.js @@ -1,8 +1,9 @@ openerp.auth_oauth = function(instance) { var QWeb = instance.web.qweb; - instance.web.Login = instance.web.Login.extend({ + instance.web.Login.include({ start: function(parent, params) { + var self = this; var d = this._super.apply(this, arguments); this.$el.on('click', 'a.zocial', this.on_oauth_sign_in); this.oauth_providers = []; @@ -11,7 +12,13 @@ openerp.auth_oauth = function(instance) { } else if(this.params.oauth_error === 2) { this.do_warn("Authentication error",""); } - return d.then(this.do_oauth_load); + return d.then(this.do_oauth_load).fail(function() { + self.do_oauth_load([]); + }); + }, + on_db_loaded: function(result) { + this._super.apply(this, arguments); + this.$("form [name=db]").change(this.do_oauth_load); }, do_oauth_load: function() { var db = this.$("form [name=db]").val(); @@ -21,6 +28,7 @@ openerp.auth_oauth = function(instance) { }, on_oauth_loaded: function(result) { this.oauth_providers = result; + this.$('.oe_oauth_provider_login_button').remove(); var buttons = QWeb.render("auth_oauth.Login.button",{"widget":this}); this.$(".oe_login_pane form ul").after(buttons); }, @@ -33,7 +41,7 @@ openerp.auth_oauth = function(instance) { var state_object = { d: dbname, p: p.id - } + }; var state = JSON.stringify(state_object); var params = { response_type: 'token', |
