summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/libs/bootstrap.js
AgeCommit message (Collapse)Author
2020-09-24[FIX] website, *: review modal behaviors with right-panelizationqsm-odoo
*: web, web_editor Since the right-panelization made with [1], the modals were not compensating the body scrollbar when opened anymore and the backdrop was misplaced. This commit fixes the problems generically, to support modals with non-body scrolling. [1]: https://github.com/odoo/odoo/pull/57975 closes odoo/odoo#58414 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-09-22[IMP] website, *: move page scrollbar to #wrapwrapqsm-odoo
*: web, web_editor, portal, account, website_blog, website_forum This is probably not ideal to move the scrolling behavior out of the html element but this will be needed for the editor to not have a double scrollbar on the right. This is actually also useful for the scrollbar to appear under the purple odoo menu instead of its right. This commit, if to be reverted in the future, however contains many improvements to make the transition easier that should be kept: jQuery and Odoo functions to be able to scrollTo a specific element, get the top scrollable element, check if an element is scrollable, etc. Also, some magic was done: if some code tries to scroll to a specific scroll position via jQuery's scrollTop or animate functions on the html/body element, those will still work as intended (obviously, using the new utils to do that is however recommended). This commit also reviews our scroll behaviors to make them more robust and share the code. Part of https://github.com/odoo/odoo/pull/57975 task-2344227
2019-10-01[FIX] web, *: review Bootstrap tooltip/popover sanitizationqsm-odoo
* website_sale_comparison The Bootstrap sanitization introduced with BS 4.3.1 was disabled with https://github.com/odoo/odoo/commit/36caf5fc16b5a95a0bf37f08f0caf974683b2df6 https://github.com/odoo/odoo/commit/ee94decd30c4514d5bc410b1652bc6464bb600aa This commit re-enables it by default but extends it to accept more common tag names like tables and buttons. If a specific tooltip or popover must accept custom tags or attributes (such as data-* attributes required by a related JS), they must be supplied through the whitelist BS parameter explicitely (see example with website_sale_comparison in this commit). Note: data-oe-* attributes are also whiteListed by default. We cannot disable sanitization because bootstrap uses tooltip/popover DOM attributes in an "unsafe" way. closes odoo/odoo#37631 Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2019-05-09[FIX] web: disable sanitization for bootstrap popoverPriyanka Kakadiya
Since saas-11.3: Bootstrap sanitizer sanitizes html and removes attributes which are not defined in whitelist, here is the documentation link: https://getbootstrap.com/docs/4.3/getting-started/javascript/#sanitizer Restore sanitize=false for bootstrap popover. A scenario where the sanitizer will break a popover: compare 2 products and open Compare popover and try to delete a comparison item from the popover -> item can not be deleted because data-product_product_id has been removed by sanitizer and so the item can not be deleted because deletion logic depends on data-product_product_id. Reference commit: https://github.com/odoo/odoo/commit/36caf5fc16b5a95a0bf37f08f0caf974683b2df6 Closes https://github.com/odoo/odoo/pull/31961 task-1950702
2019-02-27[FIX] web: disable (new) sanitization of tooltipsqsm-odoo
Bootstrap 4.3.1 introduced tooltip sanitization. Odoo should normally use tooltips for secure content anyway, so this commit disables this sanitization. A proper analyse of our tooltip should however be done to know if sanitizing is needed (it can also be enabled case by case).
2018-08-07[FIX] web: BS4, fix tooltip flickering issuesSiddarth Gajjar
Closes #26186
2018-07-27[REF] web, *: BS4, adapt use of tooltip/popover.jsqsm-odoo
2017-06-21[IMP] web, *: reorganize our libraries' extensionsqsm-odoo
* web_editor, web_tour, website_event_track Before this commit, one JS file was responsible for all the library extensions and fixes. There were two main problems with this system: - The file was only available in the backend (as some extensions are made on backend-only libraries). - Some other modules were doing library customizations. This commit creates one file per library to regroup their associated customization and adds them in the right asset. These are placed in the web module and every other module should avoid doing customizations. This allows to have libraries consistency accross all modules and between the backend and the frontend.