[FIX] focus/blur in fieldm2mtags in case of tabbing in/out

bzr revid: xmo@openerp.com-20121114114508-g97xdgq4a4fhpmjz
This commit is contained in:
Xavier Morel 2012-11-14 12:45:08 +01:00
parent e1f5dfc388
commit 01630d6800
1 changed files with 12 additions and 7 deletions

View File

@ -3992,13 +3992,18 @@ instance.web.form.FieldMany2ManyTags = instance.web.form.AbstractField.extend(in
self._drop_shown = true;
});
self.tags = self.$text.textext()[0].tags();
self.$text.focusout(function() {
self.$text.trigger("setInputData", "");
}).keydown(function(e) {
if (e.which === $.ui.keyCode.TAB && self._drop_shown) {
self.$text.textext()[0].autocomplete().selectFromDropdown();
}
});
self.$text
.focusin(function () {
self.trigger('focused');
})
.focusout(function() {
self.$text.trigger("setInputData", "");
self.trigger('blurred');
}).keydown(function(e) {
if (e.which === $.ui.keyCode.TAB && self._drop_shown) {
self.$text.textext()[0].autocomplete().selectFromDropdown();
}
});
},
set_value: function(value_) {
value_ = value_ || [];