From fc9b3ecf208affd6cf2ec162f6aa4408c559e657 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 20 Mar 2012 16:36:34 +0100 Subject: [PATCH] [FIX] force renderFacets on VS search event originally this comes from the (monkeypatch-removed) serialization and reloading of the VS searchQuery. This is needed because on ``SearchFacet#remove`` VS launches a ``searchEvent``, and counts on *that* to visually impact the removal of a given facet (by just re-rendering everything) bzr revid: xmo@openerp.com-20120320153634-rhguje7to3f0dj2p --- addons/web/static/src/js/search.js | 3 ++- doc/search-view.rst | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index fdeaacfd2ff..a0795e45427 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -42,10 +42,11 @@ if (SearchBox_renderSearchInput.toString() !== VS.ui.SearchBox.prototype.renderS } var SearchBox_searchEvent = function (e) { var query = this.value(); + this.renderFacets(); 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\);\n[ ]{4}/, '')) { + /this\.focusSearch\(e\);\n[ ]{4}this\.value\(query\)/, 'this.renderFacets()')) { throw new Error( "Trying to replace wrong version of VS.ui.SearchBox#searchEvent. " + "Please fix replacement."); diff --git a/doc/search-view.rst b/doc/search-view.rst index 762d1dd5a6c..17a5914d33b 100644 --- a/doc/search-view.rst +++ b/doc/search-view.rst @@ -99,7 +99,7 @@ Finally, :js:func:`VS.ui.SearchBox.searchEvent` is monkey-patched to get rid of its serialize/load round-tripping of facet data: the additional attributes needed by the search view don't round-trip (at all) so VisualSearch must not load any data from its (fairly -simplistic) text-serialization format +simplistic) text-serialization format. .. note::