[FIX] trigger search and correctly position cursor after adding a facet through completion
bzr revid: xmo@openerp.com-20120321164213-o1dgm4dihtrb45bt
This commit is contained in:
parent
60c07691f1
commit
9415f59853
|
@ -43,10 +43,12 @@ if (SearchBox_renderSearchInput.toString() !== VS.ui.SearchBox.prototype.renderS
|
|||
var SearchBox_searchEvent = function (e) {
|
||||
var query = this.value();
|
||||
this.renderFacets();
|
||||
this.focusSearch(e);
|
||||
this.app.options.callbacks.search(query, this.app.searchQuery);
|
||||
};
|
||||
if (SearchBox_searchEvent.toString() !== VS.ui.SearchBox.prototype.searchEvent.toString().replace(
|
||||
/this\.focusSearch\(e\);\n[ ]{4}this\.value\(query\)/, 'this.renderFacets()')) {
|
||||
/this\.focusSearch\(e\);\n[ ]{4}this\.value\(query\)/,
|
||||
'this\.renderFacets();\n this\.focusSearch(e)')) {
|
||||
throw new Error(
|
||||
"Trying to replace wrong version of VS.ui.SearchBox#searchEvent. "
|
||||
+ "Please fix replacement.");
|
||||
|
@ -200,6 +202,7 @@ openerp.web.SearchView = openerp.web.Widget.extend(/** @lends openerp.web.Search
|
|||
e.preventDefault();
|
||||
this.vs.searchQuery.add(new VS.model.SearchFacet(_.extend(
|
||||
{app: this.vs}, ui.item)));
|
||||
this.vs.searchBox.searchEvent({});
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue