diff options
| author | Xavier Morel <xmo@openerp.com> | 2013-02-25 12:06:14 +0100 |
|---|---|---|
| committer | Xavier Morel <xmo@openerp.com> | 2013-02-25 12:06:14 +0100 |
| commit | 021086d5a8ce413e97cbc2cc66a2f2f81ae05978 (patch) | |
| tree | 68ffa10e8cbc5b0699db4bb6b5275828405cb5fa /addons/web/static/src | |
| parent | 932a63ce36fe51e933ee8af5c4b05b2143143eed (diff) | |
[FIX] Search view's drawer closing unexpectedly when using the date widget
jquery-ui's date picker (at least in currently used version) lets
*some* (but not all) clicks go through. The date picker dialog is
added directly to the page body so capturing clicks in a parent widget
doesn't work, and these "stray" bubbling clicks will trigger the
global bus's "click" event.
Add a capturing (and stopPropagation-ing) of these clicks in our
wrapper to jquery-ui's datepicker to avoid the issue.
lp bug: https://launchpad.net/bugs/1095283 fixed
bzr revid: xmo@openerp.com-20130225110614-p7dmmjd41xdxescy
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/view_form.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index b59838da5e9..81b9eb9bc9e 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2402,6 +2402,11 @@ instance.web.DateTimeWidget = instance.web.Widget.extend({ showButtonPanel: true, firstDay: Date.CultureInfo.firstDayOfWeek }); + // Some clicks in the datepicker dialog are not stopped by the + // datepicker and "bubble through", unexpectedly triggering the bus's + // click event. Prevent that. + this.picker('widget').click(function (e) { e.stopPropagation(); }); + this.$el.find('img.oe_datepicker_trigger').click(function() { if (self.get("effective_readonly") || self.picker('widget').is(':visible')) { self.$input.focus(); |
