[ADD] correct handling of input blurring

bzr revid: xmo@openerp.com-20120502132743-dr29i2fvrpo6tute
This commit is contained in:
Xavier Morel 2012-05-02 15:27:43 +02:00
parent 25a30ad0ce
commit a40e410d1a
1 changed files with 11 additions and 4 deletions

View File

@ -122,10 +122,17 @@ my.InputView = instance.web.Widget.extend({
start: function () {
var self = this;
var p = this._super.apply(this, arguments);
this.$element.on('focus', function () {
self.$element.siblings().trigger('deselect');
});
this.$element.on('focus', this.proxy('onFocus'));
this.$element.on('blur', this.proxy('onBlur'));
return p;
},
onFocus: function () {
this.$element.siblings().trigger('deselect');
this.getParent().$element.trigger('focus');
},
onBlur: function () {
this.$element.text('');
this.getParent().$element.trigger('blur');
}
});
my.FacetView = instance.web.Widget.extend({
@ -302,7 +309,7 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea
});
var completer = this.$element.autocomplete({
this.$element.autocomplete({
source: this.proxy('complete_global_search'),
select: this.proxy('select_completion'),
focus: function (e) { e.preventDefault(); },