summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/components/dropdown_menu.js
AgeCommit message (Collapse)Author
2021-02-01[FIX] web: Auto close dropdown is brokenRomain Estievenart
Steps to reproduce: 1. Go to Project App 2. Open and edit a task 3. Click on Customer => search more 5. Click on "Filters" 6. Click on "Group by" => The "Filters" and "Group by" dropdown are open at same time => bug Since odoo/odoo@e4f87710e16357f24f388159a7b1e82eccda598a, we added a way to prevent bs and owl dropdown to be open in the same time. But when the web-editor is present, the CSS selector used to match the opened modal ("search more" in this case) conflicts with the DOM created by the web-editor (modals identified by the classes: .web-editor, .note-picture-dialog, .note-link-dialog, .note-help-dialog). To avoid this conflict, this commit uses a more restrictive CSS selector to match only the first (active) opened modal (as web-editor doesn't attach its modals at the root of the body). closes odoo/odoo#65274 Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
2020-11-03[FIX] web: datepicker inside a dropdownRomain Estievenart
Steps to reproduce: 1. Go to Project 2. Filter > Add custom filter > Last Updated on 3. Click on the date field and use the date picker to change the value 4. The dropdown is closed and you lost your selection => BUG This bug was due to a conflict between owl and bs dropdown (e4f87710), to prevent this bug, we added a check to ensure there are no open bootstrap calendar inside the current dom. Note that if you click outside the dropdown, the datepicker is already closed when you go through this code. It means that the datepicker will not be present in the DOM anymore and the dropdown can be closed too. opw-2373573 closes odoo/odoo#61258 X-original-commit: 73dfc1f7a8e2197fcdd4053ec57c260576593a15 Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com> Signed-off-by: res-odoo <res-odoo@users.noreply.github.com>
2020-10-28[FIX] web: DropdownMenu autoclose behavior should match BootstrapRomain Estievenart
Before this commit, with an opened DropdownMenu component, when the user clicks on a Bootstrap's dropdown the DropdownMenu doesn't close. This issue is due to a conflict between the global click listener registered to close the DropdownMenu and the listener registered by the Bootstrap dropdown: the last one prevents the event from bubbling up to the `window` element and be handled by the first one. This commit fixes it by enabling the `capture` flag on the DropdownMenu global click listener, giving it the opportunity to handling it properly and close the DropdownMenu. Note: this commit also fixes an issue when a dialog is opened from a DropdownMenu (like the favorite's delete action) and prevents it from closing in the background (e.g. when the dialog is still opened). opw-1879566 closes odoo/odoo#60909 X-original-commit: e4f87710e16357f24f388159a7b1e82eccda598a Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
2020-09-16[FIX] web: prevent dropdown closing on mouseupHardik Prajapati
Before this commit, selecting the whole content of the custom filter input and releasing the cursor outside of the dropdown closed the dropdown. With this commit, the dropdown is kept open in this situation. task - 2276544 closes odoo/odoo#55660 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com> Co-authored-by: Mohammed Shekha <msh@odoo.com>
2020-06-29[FIX] web: update action on archive/unarchiveHardik Prajapati
Before this commit, when archiving a record through the action menu, the 'Archive' link was not updated to 'Unarchive' and same when unarchive was clicked, the link was not updated to 'Archive'. After this commit, when archiving a record through the action menu, the 'Archive' link is updated to 'Unarchive', same way when unarchiving a record link is updated to 'Archive'. This commit also introduces a new prop 'closeOnSelected' to the Dropdown component, to specify whether the dropdown should be closed when an item is selected, and makes Action Menu dropdown closed on item selected. task-2251739 closes odoo/odoo#53835 X-original-commit: dc5d02ade7747c74c31566c74932ef45c30e9356 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com> Co-authored-by: Mohammed Shekha <msh@odoo.com>
2020-06-04[REF] web: force dropdown menu icon through getterJulien Mougenot
Before this ref, the dropdown menu got his icon directly from his props. This means that any inheriting class had either to define its icon with the 'default_props' key or to have its parent giving it in the props. Now, the icon is retrieved from the props via a getter (same as title and items) and can be overridden to force a fixed icon on the class.
2020-05-04[IMP] web: ControlPanel: remove dropdown caretspka-odoo
Part of task 2234547 closes odoo/odoo#49793 Related: odoo/enterprise#10059 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com> Co-authored-by: Mohammed Shekha <msh@odoo.com> Co-authored-by: Aaron Bohy <aab@odoo.com>
2020-03-13[REF] web: Control panel OwlJulien Mougenot
Refactoring of the control panel with the Owl framework. The MVC structure of the control panel has been changed to a 'component <-> model' relationship. As such: - Removed the old control panel: view/model/controller/renderer - Created a new Owl Component (ControlPanel) - Created a new class: the Model (an Owl Store did not fit here) and a newly designed ControlPanelModel extending it Refactored all inner subcomponents, including: - Pager - ActionMenus (peviously SideBar) - Filter menu > Custom filter item - Group by menu > Custom group by item > Removal of groupby_menu_mixin (and refactored graph controller in sibling commit) - Time range menu - Favorite menu > Custom favorite item > Moved the favorite menu registry to the favorite_menu file - Search bar > Removed and splitted auto-completion dropdown logic between the new SearchBar Component (descriptions) and to the new ControlPanelModel (domains). The templates (all in web/base.xml) have been adapted to the new standards. Most of the DOM structure remains unchanged with some occasional improvements (replace hiding with not rendering, removed pointless wrapper divs, etc.). Part of task 2196029 Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>