[FIX] blurring propagation on m2m tag fields

lp bug: https://launchpad.net/bugs/1153492 fixed

bzr revid: xmo@openerp.com-20130312131412-mtcl932of1466n2j
This commit is contained in:
Xavier Morel 2013-03-12 14:14:12 +01:00
parent 3aa39206f9
commit ee46eb8015
1 changed files with 6 additions and 1 deletions

View File

@ -4037,6 +4037,7 @@ instance.web.form.FieldMany2ManyTags = instance.web.form.AbstractField.extend(in
if (this.get("effective_readonly"))
return;
var self = this;
var ignore_blur = false;
self.$text = this.$("textarea");
self.$text.textext({
plugins : 'tags arrow autocomplete',
@ -4055,6 +4056,7 @@ instance.web.form.FieldMany2ManyTags = instance.web.form.AbstractField.extend(in
if (data.id) {
self.add_id(data.id);
} else {
ignore_blur = true;
data.action();
}
},
@ -4105,10 +4107,13 @@ instance.web.form.FieldMany2ManyTags = instance.web.form.AbstractField.extend(in
self.$text
.focusin(function () {
self.trigger('focused');
ignore_blur = false;
})
.focusout(function() {
self.$text.trigger("setInputData", "");
self.trigger('blurred');
if (!ignore_blur) {
self.trigger('blurred');
}
}).keydown(function(e) {
if (e.which === $.ui.keyCode.TAB && self._drop_shown) {
self.$text.textext()[0].autocomplete().selectFromDropdown();