diff options
| author | Xavier Morel <xmo@openerp.com> | 2012-09-05 14:04:55 +0200 |
|---|---|---|
| committer | Xavier Morel <xmo@openerp.com> | 2012-09-05 14:04:55 +0200 |
| commit | 80daa1b9565b2521d9b784878cbf81aca068a200 (patch) | |
| tree | 5b7e78bda8acfa8c5f03b34dc93e614b3b58143c /addons/web/static/src | |
| parent | dc6b5e92bf742c775eb4228dbae221321f31bedd (diff) | |
[FIX] incorrect reversion of m2o autocomplete mouse-based selection fix by revision vta@openerp.com-20120808154422-nbjabrc3cxcb030g
bzr revid: xmo@openerp.com-20120905120455-92llmuwv267xdrn5
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/view_form.js | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 1cefd28a5a0..f65da67d8fb 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2846,7 +2846,21 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc self.tip_def.reject(); } }; - this.$input.focusout(anyoneLoosesFocus); + var ignore_blur = false; + this.$input.on({ + focusout: anyoneLoosesFocus, + focus: function () { self.trigger('focused'); }, + autocompleteopen: function () { ignore_blur = true; }, + autocompleteclose: function () { ignore_blur = false; }, + blur: function () { + // autocomplete open + if (ignore_blur) { return; } + if (_(self.getChildren()).any(function (child) { + return child instanceof instance.web.form.AbstractFormPopup; + })) { return; } + self.trigger('blurred'); + } + }); var isSelecting = false; // autocomplete @@ -2888,7 +2902,7 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc } isSelecting = false; }); - this.setupFocus(this.$input.add(this.$follow_button)); + this.setupFocus(this.$follow_button); }, render_value: function(no_recurse) { var self = this; |
