Merge lp:~openerp-dev/openerp-web/7.0-bug-1095283-bth into lp:openerp-web/7.0

Proposed by Bhumi Thakkar (Open ERP)
Status: Rejected
Rejected by: Xavier (Open ERP)
Proposed branch: lp:~openerp-dev/openerp-web/7.0-bug-1095283-bth
Merge into: lp:openerp-web/7.0
Diff against target: 12 lines (+1/-1)
1 file modified
addons/web/static/src/js/search.js (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openerp-web/7.0-bug-1095283-bth
Reviewer Review Type Date Requested Status
Xavier (Open ERP) (community) Disapprove
Vidhin Mehta (OpenERP) (community) Needs Resubmitting
Fabien Meghazi (OpenERP) (community) Needs Fixing
Review via email: mp+144282@code.launchpad.net

Description of the change

Hello,

   Close searchview when click on Done button in datepicker in advance search.

To Reproduce:
1. open the search bar menu
2. click on "advanced search"
3. select date
4. click on the calendar icon
5. click on done
=> the whole menu disappears. it should not.

Thanks.

To post a comment you must log in.
Revision history for this message
Fabien Meghazi (OpenERP) (fme) wrote :

Please, merge your jquery selectors when possible :

if ($(ev.target).parents('.oe_searchview').length === 0 && $(ev.target).parents('div#ui-datepicker-div').length === 0) { ...

could be

if (!$(ev.target).parents('.oe_searchview, div#ui-datepicker-div').length) { ...

review: Needs Fixing
3710. By Vidhin Mehta (OpenERP)

[MERGE]7.0

3711. By Vidhin Mehta (OpenERP)

[FIX]check on direct jquery datetime picker.

Revision history for this message
Vidhin Mehta (OpenERP) (vme-openerp) wrote :

In above solution if we click on "Now" button or near about "Now" button,then also same issue observed.
Directly check datetimewidget's dom *is visible or not* from that decide searchview's should remove 'oe_searchview_open_drawer' or not.

review: Needs Resubmitting
Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote :

This is not the correct way to fix it: it puts direct knowledge that a sub-widget uses a jquery-ui datetime picker in the search view core (bad) *and* means other views which find themselves in the same situation will have to reimplement the exclusion.

A better fix is to fix the datetime widget or jquery-ui widget.

review: Disapprove

Unmerged revisions

3711. By Vidhin Mehta (OpenERP)

[FIX]check on direct jquery datetime picker.

3710. By Vidhin Mehta (OpenERP)

[MERGE]7.0

3709. By Bhumi Thakkar (Open ERP)

[FIX] Click on done button in datepicker close only datepicker not searchview.--fixes:lp1095283

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/web/static/src/js/search.js'
2--- addons/web/static/src/js/search.js 2013-02-20 16:33:06 +0000
3+++ addons/web/static/src/js/search.js 2013-02-21 13:59:22 +0000
4@@ -396,7 +396,7 @@
5 }
6
7 instance.web.bus.on('click', this, function(ev) {
8- if ($(ev.target).parents('.oe_searchview').length === 0) {
9+ if ($(ev.target).parents('.oe_searchview').length === 0 && !$('div#ui-datepicker-div').is(":visible")) {
10 self.$el.removeClass('oe_searchview_open_drawer');
11 }
12 });