summaryrefslogtreecommitdiff
path: root/addons/website/static/src/js/content/snippets.animation.js
AgeCommit message (Collapse)Author
2021-04-10[FIX] website: restore scroll effects in custom codeqsm-odoo
The website scroll effects using the `AnimationEffect` Odoo API were not working anymore if custom code enforces the html element as the scrolling element. Indeed in that case the scroll event handlers were now attached to the html element itself while it needs to be the window in that case. This may be something to fix at the source (the `getScrollingElement` method). This will be checked later. closes odoo/odoo#69083 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-19[FIX] website: restore footer slideout effect on Firefoxqsm-odoo
For some strange reason, the footer slideout effect was not working on Firefox anymore. The height of the footer is not understood by Firefox sticky implementation which it seems to not understand because of the combination of 3 items: the footer is the last :visible element in the `#wrapwrap`, the `#wrapwrap` uses flex layout and the `#wrapwrap` is the element with a scrollbar. As neither of the last two items can be changed, this commit fixes the problem by adding a pixel div element in the DOM after the footer on page load, if the slideout effect is enabled. This is obviously not ideal but solves the problem while waiting for another solution. Part of https://github.com/odoo/odoo/pull/60271 task-2312878 closes odoo/odoo#60271 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-09-29[REM] website: remove the folded list snippetAntoine Guenet
2020-09-29[FIX] website: fix full height snippet optionBenjamin Vray
Before this commit the height of a snippet with the full height option enabled was not correctly updated. task-2312878 closes odoo/odoo#58760 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
2020-09-22[FIX] website, *: make scroll to anchor consider the fixed headerqsm-odoo
*: website_blog This was fixed and rebroken quite a few times. Hopefully, with this commit and the next ones, the feature will be more robust: when clicking on a link anchor, the animation now considers the fixed header height if any *even if the header becomes fixed during the animation*. Part of https://github.com/odoo/odoo/pull/57975 task-2344227
2020-09-15[FIX] website, *: review scroll button and height option behaviorsqsm-odoo
*: website_blog - The scroll button option is now again available for all snippets, not only when the height is forced to 50% or 100%. Indeed, nobody would think to change that option if the snippet is already naturally tall and you could well want that scroll button on small-height covers. - The scroll button is now placed on top of the snippet content instead of below in its natural flow. This allows it to work with snippets like "Big Boxes" and actually prevent to miscenter the snippet content just by adding that scroll button. - Review the option UI and allow to control the spacing around the scroll button. - the "Big Boxes" snippet was at last adapted to work well with 50% and 100% height options. - The 100% height option has now associated JS so that the height is computed to use 100% minus the size of the header. Note: this may be backported to 13.2 where the option was introduced and where those improvements may appear essential for the feature to not be considered as buggy. Part of https://github.com/odoo/odoo/pull/57764 task-2224404
2020-08-27[IMP] website, *: add 'hamburger full' header templateCocographique
*: website_sale, website_sale_wishlist Part of https://github.com/odoo/odoo/pull/56427 task-2264627 Co-authored-by: qsm-odoo <qsm@odoo.com>
2020-08-10[IMP] website: review parallax option UIqsm-odoo
Instead of two select: Parallax: none/fixed/very slow/slow/... Direction: Bottom to top/top to bottom We now have: Parallax: none/fixed/bottom to top/top to bottom Intensity: slider Part of https://github.com/odoo/odoo/pull/47313 task-46147 closes odoo/odoo#47313 Related: odoo/design-themes#335 Related: odoo/upgrade#1553 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-08-10[IMP] website: add a direction option for the parallaxBenjamin Vray
Add a setting direction for the parallax. "Top to Bottom" or "Bottom to top". The new one was actually a specific theme option that we lost somewhere between Odoo 8.0 and Odoo 13.0. This is now standard. Part of https://github.com/odoo/odoo/pull/47313 task-46147
2020-08-10[IMP] website, *: enable the parallax option for all snippetsqsm-odoo
*: web_editor, website_blog Unfortunately, this feature revealed a new batch of flaws in the editor widgets system so some hacks were made to make it work. We will always have the time to improve the pure technical side later. This commit also separates the notion of color filter from the notion of parallax. A color filter can now be applied independantly, when there is either a background image or a background video. Applying a color filter on top of a background video is actually a new feature. Applying a color filter on top of a background image is actually now achievable by two different ways: this new color filter layer or by applying the color transformation on the image itself via the related option. Depending on the user case, both could make sense at the same time, but more importantly: having a CSS color filter is useful for using those for default Odoo content (e.g. like the current contact us page where we use a cover banner with an image with a black filter on top of it: doing that without CSS color filter would mean to alter the image directly which would not be ok when the user changes the image). Also, sometimes you want the unfiltered image on a page and the exact same one but filtered on another (for example: forum images). Note: this commit also "fixes" an issue: the optimization feature for images when parallax was enabled was not available before. Part of https://github.com/odoo/odoo/pull/47313 task-46147
2020-08-10[FIX] website: replacement linkedin share link by the 2020 versionFrancois (fge)
closes odoo/odoo#55044 Related: odoo/enterprise#12064 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-07-17[IMP] website: review gallery snippetBenjamin Vray
Review the gallery snippet. It has been improved in multiple ways. Added new options, etc. Part of https://github.com/odoo/odoo/pull/45096 task-2162952
2020-06-30[IMP] website, *: add new footer effect optionsBenjamin Vray
*: web Part of https://github.com/odoo/odoo/pull/49142 task-2229551 Co-authored-by: qsm-odoo <qsm@odoo.com>
2020-06-17[FIX] website: properly go to fixed anchorsqsm-odoo
Since the header effects are now done without duplicating the header into a fixed element, link anchors towards it were not working anymore as they could be redirected to the fixed-positioned header. This commit solves the problem "generically" for all fixed elements (I am not sure any link towards a fixed element except the header makes sense though). closes odoo/odoo#53156 X-original-commit: 1a2827f80bd7a66d4190977b22d4bc5846737b08 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-01-30[IMP] website: set anchor offset by fixed header heightBenjamin Vray
When you click on an anchor link, this commit ensures that the scroll is in the correct place if there are fixed menus on the page. Part of https://github.com/odoo/odoo/pull/40690 task-1894456
2020-01-08[IMP] website, *: add full height option and scroll down buttonSamuel Degueldre
*: website_blog, website_event This commit adds a "Height" option to sections, allowing them to have a minimum height of the user's choosing (either full screen height or half screen height, similar to blog covers). Enabling the full screen option also allows the user to add a "scroll down button" that will scroll down to the next section, also similar to blog covers. As such, the classes doing the corresponding things in website_blog and website_event have been renamed to reuse the same code. task-2155710 closes odoo/odoo#41623 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-12-31[REF] website, *: remove unused class oe_custom_bgSamuel Degueldre
*: web_editor, website_forum, website_mass_mailing, website_slides This class no longer does anything. Part of odoo/odoo#41561 task-2155808 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-12-18[FIX] website: fix background video widget on mobileJason Van Malder
Issue - Download the customer db: stargue-inc - Go on the website in mobile mode Traceback & the second item in the carousel is not displayed. Cause Traceback: we use `this.$iframe` without checking if it's defined Second item not displayed: the first video promise is overriden by the second video promise. Solution Check if this.$iframe is defined and resolve the old promise instead of overriding it. OPW-2152690 closes odoo/odoo#42139 X-original-commit: f5f569b4705f37865cb976a4df10a0d9f388fae2 Signed-off-by: Jason Van Malder <jvm-odoo@users.noreply.github.com>
2019-12-18[REF] website: move s_chart snippet to dedicated filesqsm-odoo
2019-12-18[REF] fake move of snippets.xml and options/animations.jsqsm-odoo
2019-12-18[REF] move history of xml/js to s_chart filesqsm-odoo
2019-12-18[REF] website: move s_countdown snippet to dedicated filesqsm-odoo
2019-12-18[REF] fake move of snippets.xml and animation/options.jsqsm-odoo
2019-12-18[REF] move history of xml/js to s_countdown filesqsm-odoo
2019-12-18[REF] website: move s_image_gallery snippet to dedicated filesqsm-odoo
2019-12-18[REF] fake move of snippets.xml, website.scss and animation/options.jsqsm-odoo
2019-12-18[REF] move history of xml/css/js to s_image_gallery filesqsm-odoo
2019-12-18[REF] website: move s_facebook_page snippet to dedicated filesqsm-odoo
2019-12-18[REF] fake move of snippets.xml, website.scss and animation/options.jsqsm-odoo
2019-12-18[REF] move history of xml/css/js to s_facebook_page filesqsm-odoo
2019-12-18[REF] website: move s_share snippet to dedicated filesqsm-odoo
2019-12-18[REF] fake move of snippets.xml, website.scss and animation.jsqsm-odoo
2019-12-18[REF] move history of xml/css/js to s_share filesqsm-odoo
2019-12-09[FIX] website: restore parallax designqsm-odoo
Commit https://github.com/odoo/odoo/commit/cf5b3e1db5d312133eb1af7ff0d5471db47987e5 fixed a problem by creating another one: the parallax with a given speed appeared broken on page load (which is even more visible in 13.0 with lazy loading). This commit restores the design and solves the original problem. closes odoo/odoo#41594 X-original-commit: a9aa72ecb5350cc0e9fa5b6a17d4db8d2f1895fd Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-12-09[FIX] website: disable graph animation in edit modeqsm-odoo
Especially important since all animations are restarted on any change of a snippet. closes odoo/odoo#41541 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-12-06[IMP] website, web_editor: add new chart snippetfja-odoo
Introducing a new snippet called Chart. This snippet uses the lib https://www.chartjs.org/ 6 types of graph are possible: Bar vertical Bar horizontal Line Pie Doughnut Radar task-2092267 closes odoo/odoo#40051 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-12-06[FIX] website: allow elements to overflow fixed parallaxqsm-odoo
Parallax elements are overflow:hidden so that their moving background does not overflow. This introduces a limitation: no dropdown can overflow the snippet either. While a better solution should be found in master, this allows overflow for the "fixed" parallax which does not use an overflowing background. opw-2091324 closes odoo/odoo#41492 X-original-commit: 72d3b0161a87dc28049e6595827ce60de998709e Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-12-06[IMP] web_editor, website: add new 'Countdown' snippetRomain Derie
This commit introduces a new snippet: Countdown. The countdown snippet is composed of 4 circle countdown, one for every time unit: seconds, minutes, hours and days. When countdown ends, the user can chose between 3 possible actions: 1. Nothing 2. Show message: show a message once the countdown ends. The message will be displayed bellow the countdown (stopped on 0) or will replace the countdown depending on the option selected. The message can be edited through the website builder. 3. Redirect: redirect the user to the chosen URL. If the user is on the page at the exact moment the countdown reach 0, the user will be redirected automatically. If the user lands on the page after the countdown has reached 0, there will be no redirection and the link will be shown bellow the countdown (stopped on 0) or will replace the countdown depending on the option selected. The countdown layout can be customized in multiple ways: 1. By choosing to hide some time units. For instance, seconds can be hidden or only days shown. 2. By changing its size between small/medium/large. 3. By changing its basic design (circle, boxes, clean). 4. By changing its advanced design (shape, background, progress bar..) task-2093081 closes odoo/odoo#39773 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-12-01[REF] web_editor, *: use widgets for left panel componentsqsm-odoo
Before this commit, the rendering of inner content of the left panel options was handled through _buildXXXElement methods in the options widgets. Now they are handled through sub-widgets which also handle the user events. Each sub-widget is notified with the string value it should hold according to the snippet option target and methods. Each sub-widget notifies a string value following user interactions, which snippet options can use to adapt their target through their option methods. The current sub-widgets introduced by this commit are (others will follow): 1) we-button 2) we-checkbox 3) we-input 4) we-select (typically containing multiple we-button widgets) 5) we-multi (typically containing multiple we-input widget) Following this commit only 3 standard option methods remain, which can be used with any meaningful widget: 1) selectClass -> Same as before + handle the old 'toggleClass' method when used with a checkbox-like widget. 2) selectStyle -> Same as old setStyle, introduced recently (simply renamed) 3) selectDataAttribute -> Handle both old selectDataAttribute and setDataAttribute, introduced recently The parameters these methods received are now: - previewMode: same as before - widgetValue: the string value the widget currently holds - params: additional parameters (mainly dataset of the related xml) + params.possibleValues (all the possible values for the method, meaninful for a select or a checkbox) + params.defaultValue (the value that the widget would give if it even holds no value) When defining a method in XML, the given value is the default value. e.g. data-select-style="34px" data-css-property="margin-top" -> if set on any widget, allows to retrieve a value from the user to customize the margin-top, the default value being 34px. -> if used with a we-input, allow to retrieve any value and an empty value will be equal to 34px -> if used on a checkbox, allow to toggle between no value and 34px. -> ... Hopefully, detailed documentation about all of this will follow. Code documentation should already be helpful. Last note: the _updateUI method (replacing the old _setActive) is now async (so does all the functions calling it). In particular, the _select method is now async. Part of https://github.com/odoo/odoo/pull/40282 In preparation of task-2122935 and other tasks
2019-11-07[FIX] website: restore parallax previews in edit modeqsm-odoo
When the user changed the parallax option, it was only updated on save. So, the user was not able to have a preview of what he chose. Note: this commit is made in saas-12.3 but does not fully solve the problem there... and unfortunately I don't know why. It fully solves the problem in 13.0 though and this is more important. closes odoo/odoo#39995 X-original-commit: 4b633949cd4fd1cae807b95d233879ac4adc01ce Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-11-06[REF] website, web_editor: refactor (quotes) carousel snippetsSamuel Degueldre
Previously, the carousel and quotes carousel snippets were the only ones that were not enclosed in section blocks. This had a number of undesirable side effects, such as editing the anchor on the carousel breaking the carousel functionality, and the inability to separately choose a background for the carousel itself and individual slides. I also used this opportunity to move controls relative to the entire carousel onto the carousel itself rather than the individual slides. The sizing_y (vertical padding) will however keep targeting individual slides, as the carousel uses the height of its tallest slide, and also because padding on the carousel will not get covered by slide backgrounds and saty blank, which is unwanted. Lastly, most of the snippet options for the carousel were rewritten, as they were quite broken. There was some compatibility code for saas-3 left, some useless events were bound to the controls, even though they were already handled through event-delegation at the document level. Finally, most of the edition features were broken on duplicated carousels since the onClone method wasn't reassigning most of the things it needed to. Part of https://github.com/odoo/odoo/pull/38997 task-2090180
2019-10-10[FIX] website: make background videos in mega menus workqsm-odoo
When a background video was used in a mega menu, it was only working in edit mode. Indeed, the background video size is computed on page load (and on window resize) but as the video is inside a hidden dropdown menu in this case, the size cannot be properly computed. This commit fixes the issue by recomputing the video size on dropdown menu opening. task-2080590 closes odoo/odoo#38314 X-original-commit: 66ec1c19b63fe26e559ed2d8d7359df974ade789 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-10-02[IMP] social_media, website_*: remove google+ mentionKishan Gajjar
Google+ was shut down for business use and consumers. closes odoo/odoo#36271 See: https://plus.google.com/ Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-09-17[IMP] website, *: allow to set background video to snippetsKishan Gajjar
* web_editor This commit adds support to set background videos to all the snippets that already support setting background images (except on parallax background for now). task-1920630 closes odoo/odoo#36261 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com> Co-authored-by: Varun Raval <var@odoo.com> Co-authored-by: qsm-odoo <qsm@odoo.com>
2019-07-17[IMP] account, portal, web, website: move chatter below invoicePratima Gupta
No more modal because it's not visible and less handy. Use same behavior as sales order portal. Adapt the invoice style to properly adapt and align with the chatter block. Part of task-37264 closes odoo/odoo#34360 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com> Co-authored-by: Pratima Gupta <pgu@odoo.com> Co-authored-by: Sébastien Theys <seb@odoo.com>
2019-07-04[FIX] website: restore read_events and edit_eventsqsm-odoo
Since https://github.com/odoo/odoo/pull/29442, "Animations" became "Public Widgets" (even though the Animation class still exists as an extension of standard PublicWidget). Since that refactoring an error was introduced which made the code modify the prototype of the 'events' key each time a public widget with a 'read_events' or 'edit_events' was instantiated (while the goal was to modify the widget's own 'events' key, not from the prototype). This was the cause of very ununderstandable errors... closes odoo/odoo#34600 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-06-03[MERGE] forward port branch saas-12.2 up to 995aa1685eeChristophe Simonis
2019-05-06[MERGE] forward port branch saas-12.2 up to 78b3b650b0dChristophe Simonis
2019-05-03[MERGE] forward port branch saas-12.1 up to 2420492c264Christophe Simonis